|
1 | 1 | #!/usr/bin/env python3
|
2 | 2 | # RUN: ${python} %s %target-swiftmodule-name %platform-sdk-overlay-dir \
|
| 3 | +# RUN: %swift_src_root \ |
3 | 4 | # RUN: %target-sil-opt -sdk %sdk -enable-sil-verify-all \
|
4 | 5 | # RUN: -F %sdk/System/Library/PrivateFrameworks \
|
5 | 6 | # RUN: -F "%xcode-extra-frameworks-dir"
|
|
14 | 15 |
|
15 | 16 | target_swiftmodule_name = sys.argv[1]
|
16 | 17 | sdk_overlay_dir = sys.argv[2]
|
17 |
| -sil_opt_invocation = sys.argv[3:] |
| 18 | +source_dir = sys.argv[3] |
| 19 | +sil_opt_invocation = sys.argv[4:] |
18 | 20 |
|
19 | 21 | for module_file in os.listdir(sdk_overlay_dir):
|
| 22 | + extra_args = [] |
20 | 23 | module_name, ext = os.path.splitext(module_file)
|
21 | 24 | if ext != ".swiftmodule":
|
22 | 25 | continue
|
|
33 | 36 | # TODO: fix the DifferentiationUnittest module.
|
34 | 37 | if module_name == "DifferentiationUnittest":
|
35 | 38 | continue
|
| 39 | + # Backtracing needs its own additional modules in the module path |
| 40 | + if module_name == "_Backtracing": |
| 41 | + extra_args = ["-I", os.path.join(source_dir, "stdlib", |
| 42 | + "public", "Backtracing", "modules"), |
| 43 | + "-I", os.path.join(source_dir, "include")] |
| 44 | + |
36 | 45 | print("# " + module_name)
|
37 | 46 |
|
38 | 47 | module_path = os.path.join(sdk_overlay_dir, module_file)
|
|
50 | 59 | # We are deliberately discarding the output here; we're just making sure
|
51 | 60 | # it can be generated.
|
52 | 61 | subprocess.check_output(sil_opt_invocation +
|
53 |
| - [module_path, "-module-name", module_name]) |
| 62 | + [module_path, "-module-name", module_name] + |
| 63 | + extra_args) |
0 commit comments