Skip to content

Commit f57c167

Browse files
committed
build: allow building libswift with unified builds
When building with unified builds, `CMAKE_SOURCE_DIR` is not the Swift repository. Use the locally defined `SWIFT_SOURCE_DIR` variable to reference the root of the Swift repository. Because libswift uses `project` in the CMakeLists, we cannot use `PROJECT_SOURCE_DIR` here.
1 parent 6b558d2 commit f57c167

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ function(add_libswift name)
786786
"-emit-module-path" "${build_dir}/${module}.swiftmodule"
787787
"-parse-as-library" ${sources}
788788
"-wmo" ${libswift_compile_options}
789-
"-I" "${CMAKE_SOURCE_DIR}/include/swift"
789+
"-I" "${SWIFT_SOURCE_DIR}/include/swift"
790790
"-I" "${build_dir}"
791791
COMMENT "Building libswift module ${module}")
792792

0 commit comments

Comments
 (0)