Skip to content

Commit 7441696

Browse files
Merge pull request #2054 from swiftwasm/cherry-pick-93e3e18
Set compiler vendor name as SwiftWasm
2 parents 75ee011 + eee5122 commit 7441696

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

utils/build-presets.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2446,6 +2446,7 @@ llvm-install-components=llvm-cov;llvm-profdata;IndexStore;clang;clang-resource-h
24462446
install-swift
24472447
install-llvm
24482448
install-prefix=/%(TOOLCHAIN_NAME)s/usr
2449+
compiler-vendor=swiftwasm
24492450

24502451
[preset: webassembly-host]
24512452

utils/build_swift/build_swift/driver_arguments.py

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

415415
option('--compiler-vendor', store,
416-
choices=['none', 'apple'],
416+
choices=['none', 'apple', 'swiftwasm'],
417417
default=defaults.COMPILER_VENDOR,
418418
help='Compiler vendor name')
419419
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
@@ -39,6 +39,13 @@ def _compiler_vendor_flags(self):
3939
if self.args.compiler_vendor == "none":
4040
return []
4141

42+
if self.args.compiler_vendor == "swiftwasm":
43+
return [
44+
('CLANG_VENDOR', 'SwiftWasm'),
45+
('CLANG_VENDOR_UTI', 'org.swiftwasm.compilers.llvm.clang'),
46+
('PACKAGE_VERSION', str(self.args.clang_user_visible_version))
47+
]
48+
4249
if self.args.compiler_vendor != "apple":
4350
raise RuntimeError("Unknown compiler vendor?!")
4451

utils/swift_build_support/swift_build_support/products/swift.py

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

62-
if self.args.compiler_vendor != "apple":
63-
raise RuntimeError("Unknown compiler vendor?! Was build-script \
64-
updated without updating swift.py?")
65-
6662
swift_compiler_version = ""
6763
if self.args.swift_compiler_version is not None:
6864
swift_compiler_version = self.args.swift_compiler_version
6965

66+
if self.args.compiler_vendor == "swiftwasm":
67+
return [
68+
('SWIFT_VENDOR', 'SwiftWasm'),
69+
('SWIFT_VENDOR_UTI', 'org.swiftwasm.compilers.llvm.swift'),
70+
('SWIFT_VERSION', str(self.args.swift_user_visible_version)),
71+
('SWIFT_COMPILER_VERSION', str(swift_compiler_version)),
72+
]
73+
74+
if self.args.compiler_vendor != "apple":
75+
raise RuntimeError("Unknown compiler vendor?! Was build-script \
76+
updated without updating swift.py?")
77+
7078
return [
7179
('SWIFT_VENDOR', 'Apple'),
7280
('SWIFT_VENDOR_UTI', 'com.apple.compilers.llvm.swift'),

0 commit comments

Comments
 (0)