Skip to content

Commit d28e1c9

Browse files
committed
[CMake] Fix swift_supports_implicit_module failure
swift_supports_implicit_module invokes /path/to/toolchain/usr/bin/swiftc directly without using `xcrun`. That fails to set necessary environmental variables to make swiftc infer the SDK path. Because of that swift_supports_implicit_module used to fail because the test compilation fails to load the stdlib. This PR workaround it by passing `-parse-stdlib` to avoid implicit stdlib loading.
1 parent e137b32 commit d28e1c9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cmake/modules/SwiftImplicitImport.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ function(swift_supports_implicit_module module_name out_var)
55
COMMAND
66
"${CMAKE_Swift_COMPILER}"
77
-Xfrontend -disable-implicit-${module_name}-module-import
8+
-Xfrontend -parse-stdlib
89
-c - -o /dev/null
910
INPUT_FILE
1011
"${CMAKE_BINARY_DIR}/tmp/empty-check-${module_name}.swift"

0 commit comments

Comments
 (0)