@@ -29,18 +29,27 @@ let package = Package(
2929 . linkedLibrary( " wasi-emulated-signal " , . when( platforms: [ . wasi] ) ) ,
3030 . linkedLibrary( " wasi-emulated-process-clocks " , . when( platforms: [ . wasi] ) ) ,
3131 . linkedLibrary( " wasi-emulated-getpid " , . when( platforms: [ . wasi] ) ) ,
32+ . linkedLibrary( " dl " , . when( platforms: [ . linux] ) ) ,
3233 . linkedLibrary( " m " , . when( platforms: [ . linux, . android] ) ) ,
33- . linkedLibrary( " pthread " , . when( platforms: [ . custom( " freebsd " ) ] ) ) ,
34+ . linkedLibrary( " pthread " , . when( platforms: [ . linux , . custom( " freebsd " ) ] ) ) ,
3435 ]
3536 ) ,
3637 . target(
3738 name: " SwiftToolchainCSQLite " ,
3839 path: " Sources/CSQLite " ,
39- publicHeadersPath: " include " ,
40- linkerSettings: [
41- // Needed for swift_addNewDSOImage
42- . linkedLibrary( " swiftCore " , . when( platforms: [ . windows, . wasi] ) )
43- ]
40+ publicHeadersPath: " include "
4441 ) ,
4542 ]
4643)
44+
45+ // Workaround for: undefined symbol: swift_addNewDSOImage
46+ // (this should be resolved by Swift Build becoming the default build system)
47+ if Context . environment [ " GITHUB_JOB " ] != " embedded-wasm-sdk-build " {
48+ for target in package . targets {
49+ if target. name == " SwiftToolchainCSQLite " {
50+ target. linkerSettings = [
51+ . linkedLibrary( " swiftCore " , . when( platforms: [ . windows, . wasi] ) )
52+ ]
53+ }
54+ }
55+ }
0 commit comments