Skip to content

Set compiler vendor name as SwiftWasm #1921

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion utils/build_swift/build_swift/driver_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def create_argument_parser():
'fuzzing swiftc')

option('--compiler-vendor', store,
choices=['none', 'apple'],
choices=['none', 'apple', 'swiftwasm'],
default=defaults.COMPILER_VENDOR,
help='Compiler vendor name')
option('--clang-compiler-version', store,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ def _compiler_vendor_flags(self):
if self.args.compiler_vendor == "none":
return []

if self.args.compiler_vendor == "swiftwasm":
return [
('CLANG_VENDOR', 'SwiftWasm'),
('CLANG_VENDOR_UTI', 'org.swiftwasm.compilers.llvm.clang'),
('PACKAGE_VERSION', str(self.args.clang_user_visible_version))
]

if self.args.compiler_vendor != "apple":
raise RuntimeError("Unknown compiler vendor?!")

Expand Down
16 changes: 12 additions & 4 deletions utils/swift_build_support/swift_build_support/products/swift.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,22 @@ def _compiler_vendor_flags(self):
if self.args.compiler_vendor == "none":
return []

if self.args.compiler_vendor != "apple":
raise RuntimeError("Unknown compiler vendor?! Was build-script \
updated without updating swift.py?")

swift_compiler_version = ""
if self.args.swift_compiler_version is not None:
swift_compiler_version = self.args.swift_compiler_version

if self.args.compiler_vendor == "swiftwasm":
return [
('SWIFT_VENDOR', 'SwiftWasm'),
('SWIFT_VENDOR_UTI', 'org.swiftwasm.compilers.llvm.swift'),
('SWIFT_VERSION', str(self.args.swift_user_visible_version)),
('SWIFT_COMPILER_VERSION', str(swift_compiler_version)),
]

if self.args.compiler_vendor != "apple":
raise RuntimeError("Unknown compiler vendor?! Was build-script \
updated without updating swift.py?")

return [
('SWIFT_VENDOR', 'Apple'),
('SWIFT_VENDOR_UTI', 'com.apple.compilers.llvm.swift'),
Expand Down
1 change: 1 addition & 0 deletions utils/webassembly/build-presets.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ cmake-cxx-launcher=%(C_CXX_LAUNCHER)s
skip-build-benchmarks
llvm-targets-to-build=X86;AArch64;WebAssembly
swift-darwin-supported-archs=x86_64
compiler-vendor=swiftwasm

[preset: webassembly-install]

Expand Down