Fix Swift linking

This commit is contained in:
Richard Feldman 2022-11-18 14:26:04 -05:00
parent ba90cbfbd2
commit ebc314691c
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B

View file

@ -540,6 +540,10 @@ pub fn build_swift_host_native(
.arg("swiftc")
.args(sources)
.arg("-emit-object")
// `-module-name host` renames the .o file to "host" - otherwise you get an error like:
// error: module name "legacy_macos-arm64" is not a valid identifier; use -module-name flag to specify an alternate name
.arg("-module-name")
.arg("host")
.arg("-parse-as-library")
.args(["-o", dest]);