• Home
  • Raw
  • Download

Lines Matching +full:build +full:- +full:swift

2 # Use of this source code is governed by a BSD-style license that can be
24 - arg_name: string corresponding to the argument to pass to the compiler
25 - arg_join: function taking the compiler name and returning whether the
27 - to_swift: function taking the argument value and returning whether it
28 must be passed to the swift compiler
29 - to_clang: function taking the argument value and returning whether it
46 if self._arg_join('swift'):
54 swiftc_args.append('-Xcc')
57 swiftc_args.append('-Xcc')
59 swiftc_args.append('-Xcc')
64 """Argument forwarder for -I and -isystem."""
70 to_swift=lambda _: arg_name != '-isystem',
75 """Argument forwarder for -F and -Fsystem."""
86 """Argument forwarder for -D."""
98 ('include_dirs', IncludeArgumentForwarder('-I')),
99 ('system_include_dirs', IncludeArgumentForwarder('-isystem')),
100 ('framework_dirs', FrameworkArgumentForwarder('-F')),
101 ('system_framework_dirs', FrameworkArgumentForwarder('-Fsystem')),
102 ('defines', DefineArgumentForwarder('-D')),
111 FileWriter is a file-like object that only write data to disk if changed.
114 in a with-clause. The data is written to disk when the context is exited,
120 If the with-clause ends with an exception, no data is written to the disk
161 """Creates the build cache directory according to `args`.
164 protocol and thus can be used in a with-clause. If -derived-data-dir
166 that will be deleted when the with-clause is exited.
198 """Generates the build signature from `env` and `args`.
200 This allow re-using the derived data dir between builds while still
202 changes to the build settings (different arguments or tool versions).
216 Create the fragment for a single .swift source file for OutputFileMap.
217 The output depends on whether -whole-module-optimization argument is
220 assert os.path.splitext(filename)[1] == '.swift', filename
226 'index-unit-output-path': f'/{rel_name}.o',
232 'const-values': f'{out_name}.swiftconstvalues',
235 'swift-dependencies': f'{out_name}.swiftdeps',
245 depends on whether -whole-module-optimization argument is used or not.
251 'const-values': f'{out_name}.swiftconstvalues',
254 'swift-dependencies': f'{out_name}.swiftdeps',
258 'emit-module-dependencies': f'{out_name}.d',
259 'emit-module-diagnostics': f'{out_name}.dia',
260 'swift-dependencies': f'{out_name}.swiftdeps',
280 """Fix the Objective-C header generated by the Swift compiler.
282 The Swift compiler assumes that the generated Objective-C header will be
283 imported from code compiled with module support enabled (-fmodules). The
287 The Swift compiler also uses absolute path when including the bridging
290 relative to the build directory
324 imports_section = (section_start, nesting_level - 1)
346 """Invokes Swift compiler to compile module according to `args`.
349 directory to use for writing intermediate build artifact (optionally
350 a temporary directory) and path to $module-OutputFileMap.json file that
353 If -fix-module-imports argument is passed, the generated header for the
371 '-parse-as-library',
372 '-module-name',
375 '-sdk',
377 '-target',
379 '-swift-version',
381 '-c',
382 '-output-file-map',
384 '-save-temps',
385 '-no-color-diagnostics',
386 '-serialize-diagnostics',
387 '-emit-dependencies',
388 '-emit-module',
389 '-emit-module-path',
391 '-emit-objc-header',
392 '-emit-objc-header-path',
394 '-working-directory',
396 '-index-store-path',
398 '-module-cache-path',
400 '-pch-output-dir',
404 # Handle optional -bridge-header flag.
406 swiftc_args.extend(('-import-objc-header', args.bridge_header))
408 # Handle swift const values extraction.
409 swiftc_args.extend(['-emit-const-values'])
411 '-Xfrontend',
412 '-const-gather-protocols-file',
413 '-Xfrontend',
417 # Handle -I, -F, -isystem, -Fsystem and -D arguments.
421 # Handle -whole-module-optimization flag.
425 '-whole-module-optimization',
426 '-no-emit-module-separately-wmo',
427 '-num-threads',
432 '-enable-batch-mode',
433 '-incremental',
434 '-experimental-emit-module-separately',
435 '-disable-cmo',
436 f'-j{num_threads}',
466 Parses all intermediate depfile generated by the Swift compiler and
509 """Compiles Swift module according to `args`."""
513 # Write the $module-OutputFileMap.json file.
516 f'{args.module_name}-OutputFileMap.json')
521 # Invoke Swift compiler.
536 parser.add_argument('--module-name',
538 help='name of the Swift module')
540 parser.add_argument('--src-dir',
544 parser.add_argument('--gen-dir',
548 parser.add_argument('--target-out-dir',
552 parser.add_argument('--header-path',
556 parser.add_argument('--bridge-header',
558 help='path to the Objective-C bridge header file')
560 parser.add_argument('--depfile-path',
564 parser.add_argument('--const-gather-protocols-file',
569 parser.add_argument('--derived-data-dir',
572 parser.add_argument('--fix-generated-header',
577 parser.add_argument('--swift-toolchain-path',
579 help='path to the Swift toolchain to use')
581 parser.add_argument('--whole-module-optimization',
586 # Required arguments (forwarded to the Swift compiler).
587 parser.add_argument('-target',
592 parser.add_argument('-sdk',
597 # Optional arguments (forwarded to the Swift compiler).
598 parser.add_argument('-I',
603 parser.add_argument('-isystem',
608 parser.add_argument('-F',
613 parser.add_argument('-Fsystem',
618 parser.add_argument('-D',
623 parser.add_argument('-swift-version',
625 help='version of the Swift language')
627 parser.add_argument('-file-compilation-dir',
633 help='Swift source files to compile')