Skip to content

Commit 93e3e18

Browse files
committed
Set compiler vendor name as SwiftWasm
1 parent ca31f89 commit 93e3e18

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

utils/build_swift/build_swift/driver_arguments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ def create_argument_parser():
417417
'fuzzing swiftc')
418418

419419
option('--compiler-vendor', store,
420-
choices=['none', 'apple'],
420+
choices=['none', 'apple', 'swiftwasm'],
421421
default=defaults.COMPILER_VENDOR,
422422
help='Compiler vendor name')
423423
option('--clang-compiler-version', store,

utils/swift_build_support/swift_build_support/products/llvm.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ def _compiler_vendor_flags(self):
4848
if self.args.compiler_vendor == "none":
4949
return []
5050

51+
if self.args.compiler_vendor == "swiftwasm":
52+
return [
53+
('CLANG_VENDOR', 'SwiftWasm'),
54+
('CLANG_VENDOR_UTI', 'org.swiftwasm.compilers.llvm.clang'),
55+
('PACKAGE_VERSION', str(self.args.clang_user_visible_version))
56+
]
57+
5158
if self.args.compiler_vendor != "apple":
5259
raise RuntimeError("Unknown compiler vendor?!")
5360

utils/swift_build_support/swift_build_support/products/swift.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,22 @@ def _compiler_vendor_flags(self):
7474
if self.args.compiler_vendor == "none":
7575
return []
7676

77-
if self.args.compiler_vendor != "apple":
78-
raise RuntimeError("Unknown compiler vendor?! Was build-script \
79-
updated without updating swift.py?")
80-
8177
swift_compiler_version = ""
8278
if self.args.swift_compiler_version is not None:
8379
swift_compiler_version = self.args.swift_compiler_version
8480

81+
if self.args.compiler_vendor == "swiftwasm":
82+
return [
83+
('SWIFT_VENDOR', 'SwiftWasm'),
84+
('SWIFT_VENDOR_UTI', 'org.swiftwasm.compilers.llvm.swift'),
85+
('SWIFT_VERSION', str(self.args.swift_user_visible_version)),
86+
('SWIFT_COMPILER_VERSION', str(swift_compiler_version)),
87+
]
88+
89+
if self.args.compiler_vendor != "apple":
90+
raise RuntimeError("Unknown compiler vendor?! Was build-script \
91+
updated without updating swift.py?")
92+
8593
return [
8694
('SWIFT_VENDOR', 'Apple'),
8795
('SWIFT_VENDOR_UTI', 'com.apple.compilers.llvm.swift'),

utils/webassembly/build-presets.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ cmake-cxx-launcher=%(C_CXX_LAUNCHER)s
88
skip-build-benchmarks
99
llvm-targets-to-build=X86;AArch64;WebAssembly
1010
swift-darwin-supported-archs=x86_64
11+
compiler-vendor=swiftwasm
1112

1213
[preset: webassembly-install]
1314

0 commit comments

Comments
 (0)