Lines Matching +full:ninja +full:- +full:linux
3 # Use of this source code is governed by a BSD-style license that can be
6 """Generates build.ninja that will build GN."""
34 if self._platform.startswith('linux'):
35 self._platform = 'linux'
65 …return ['linux', 'darwin', 'mingw', 'msys', 'msvc', 'aix', 'fuchsia', 'freebsd', 'netbsd', 'openbs…
71 return self._platform == 'linux'
98 …return self._platform in ['linux', 'freebsd', 'darwin', 'aix', 'openbsd', 'haiku', 'solaris', 'msy…
108 and be able to regenerate a corresponding command-line to be
109 written in the generated Ninja file for the 'regen' rule.
124 """Generate a gen.py argument list to be embedded in a Ninja file."""
133 assert long_option.startswith('--')
134 dest = long_option[2:].replace('-', '_')
137 # This was not set on the command-line so skip it.
161 args_list.add('-d', '--debug', action='store_true',
163 args_list.add('--platform',
167 args_list.add('--host',
171 args_list.add('--use-lto', action='store_true',
173 args_list.add('--use-icf', action='store_true',
175 args_list.add('--use-asan', action='store_true',
177 args_list.add('--use-ubsan', action='store_true',
179 args_list.add('--no-last-commit-position', action='store_true',
181 args_list.add('--out-path', type=str,
184 args_list.add('--no-strip', action='store_true',
186 args_list.add('--no-static-libstdc++', action='store_true',
189 args_list.add('--link-lib',
196 'library, or \'-l<name>\' on POSIX systems. Can be ' +
199 args_list.add('--allow-warnings', action='store_true', default=False,
203 args_list.add('--zoslib-dir',
209 'add -I<ZOSLIB_DIR>/install/include to the compile ' +
227 WriteGNNinja(os.path.join(out_dir, 'build.ninja'), platform, host, options, args_list)
234 f'{cxx} -dM -E -',
275 ' description = Regenerating ninja files',
277 'build build.ninja: regen',
279 ' depfile = build.ninja.d',
285 'msvc': 'build_win.ninja.template',
286 'mingw': 'build_linux.ninja.template',
287 'msys': 'build_linux.ninja.template',
288 'darwin': 'build_mac.ninja.template',
289 'linux': 'build_linux.ninja.template',
290 'freebsd': 'build_linux.ninja.template',
291 'aix': 'build_aix.ninja.template',
292 'openbsd': 'build_openbsd.ninja.template',
293 'haiku': 'build_haiku.ninja.template',
294 'solaris': 'build_linux.ninja.template',
295 'netbsd': 'build_linux.ninja.template',
296 'zos': 'build_zos.ninja.template',
297 'serenity': 'build_linux.ninja.template',
330 ['-I' + escape_path_ninja(dirname) for dirname in include_dirs]),
367 f.write('build.ninja: ' +
381 ar = os.environ.get('AR', 'ar -X64')
406 cflags.extend(['-O0', '-g'])
410 # moment, due to what looks like an XCode-specific Clang packaging error.
412 cflags.extend(['-D_LIBCPP_DEBUG=1', '-D_GLIBCXX_DEBUG=1'])
414 cflags.append('-DNDEBUG')
415 cflags.append('-O3')
417 cflags.append('-g')
418 ldflags.append('-O3')
419 # Use -fdata-sections and -ffunction-sections to place each function
420 # or data item into its own section so --gc-sections can eliminate any
422 cflags.extend(['-fdata-sections', '-ffunction-sections'])
423 ldflags.extend(['-fdata-sections', '-ffunction-sections'])
425 ldflags.append('-Wl,-dead_strip')
428 ldflags.append('-Wl,--gc-sections')
433 ldflags.append('-Wl,-S')
435 ldflags.append('-Wl,-s')
437 ldflags.append('-Wl,--strip-all')
440 ldflags.append('-Wl,-strip-all')
442 # Enable identical code-folding.
444 ldflags.append('-Wl,--icf=all')
447 cflags.extend(['-flto', '-fwhole-program-vtables'])
448 ldflags.extend(['-flto', '-fwhole-program-vtables'])
451 cflags.append('-fsanitize=address')
452 ldflags.append('-fsanitize=address')
455 cflags.append('-fsanitize=undefined')
456 ldflags.append('-fsanitize=undefined')
459 cflags.append('-Werror')
462 '-D_FILE_OFFSET_BITS=64',
463 '-D__STDC_CONSTANT_MACROS', '-D__STDC_FORMAT_MACROS',
464 '-pthread',
465 '-pipe',
466 '-fno-exceptions',
467 '-fno-rtti',
468 '-fdiagnostics-color',
469 '-Wall',
470 '-Wextra',
471 '-Wno-unused-parameter',
472 '-Wextra-semi',
473 '-Wundef',
474 '-std=c++20'
478 cflags.append('-Wno-redundant-move')
480 cflags.append('-Wno-restrict')
483 cflags.extend(['-Wrange-loop-analysis', '-Wextra-semi-stmt'])
486 ldflags.append('-Wl,--as-needed')
489 ldflags.append('-static-libstdc++')
492 ldflags.append('-Wl,-z,relro,-z,now')
495 cflags.remove('-std=c++20')
497 '-Wno-deprecated-copy',
498 '-Wno-implicit-fallthrough',
499 '-Wno-redundant-move',
500 '-Wno-unused-variable',
501 '-Wno-format', # Use of %llx, which is supported by _UCRT, false positive
502 '-Wno-strict-aliasing', # Dereferencing punned pointer
503 '-Wno-cast-function-type', # Casting FARPROC to RegDeleteKeyExPtr
504 '-std=gnu++20',
508 libs.append('-ldl')
510 min_mac_version_flag = '-mmacosx-version-min=10.9'
514 cflags.append('-maix64')
515 ldflags.append('-maix64')
517 cflags.append('-fPIC')
518 cflags.extend(['-D_BSD_SOURCE'])
520 cflags.append('-fzos-le-char-mode=ascii')
521 cflags.append('-Wno-unused-function')
522 cflags.append('-D_OPEN_SYS_FILE_EXT')
523 cflags.append('-DPATH_MAX=1024')
524 cflags.append('-DZOSLIB_OVERRIDE_CLIB')
527 ldflags.append('-pthread')
530 cflags.extend(['-DUNICODE',
531 '-DNOMINMAX',
532 '-DWIN32_LEAN_AND_MEAN',
533 '-DWINVER=0x0A00',
534 '-D_CRT_SECURE_NO_DEPRECATE',
535 '-D_SCL_SECURE_NO_DEPRECATE',
536 '-D_UNICODE',
537 '-D_WIN32_WINNT=0x0A00',
538 '-D_HAS_EXCEPTIONS=0'
577 '/GR-',
934 '-ladvapi32',
935 '-ldbghelp',
936 '-lkernel32',
937 '-lole32',
938 '-lshell32',
939 '-luser32',
940 '-luserenv',
941 '-lversion',
942 '-lwinmm',
943 '-lws2_32',
944 '-lshlwapi',