Skip to content

[CMake] Use CMAKE_CURRENT_SOURCE_DIR as base for includes in SwiftCompilerSources #60361

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
Aug 3, 2022
Merged
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
6 changes: 3 additions & 3 deletions SwiftCompilerSources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -237,16 +237,16 @@ else()
COMMAND
"sed"
-n -e "/header/!d" -e "s/.*header/#include/" -e "w ${CMAKE_CURRENT_BINARY_DIR}/HeaderDependencies.cpp"
"${CMAKE_SOURCE_DIR}/include/swift/module.modulemap"
DEPENDS "${CMAKE_SOURCE_DIR}/include/swift/module.modulemap"
"${CMAKE_CURRENT_SOURCE_DIR}/../include/swift/module.modulemap"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/../include/swift/module.modulemap"
COMMENT "Generate HeaderDependencies.cpp"
)

# step 2: build a library containing that source file. This library depends on all the included header files.
# The swift modules can now depend on that target.
# Note that this library is unused, i.e. not linked to anything.
add_library(importedHeaderDependencies "${CMAKE_CURRENT_BINARY_DIR}/HeaderDependencies.cpp")
target_include_directories(importedHeaderDependencies PRIVATE "${CMAKE_SOURCE_DIR}/include/swift")
target_include_directories(importedHeaderDependencies PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../include/swift")

if(${BOOTSTRAPPING_MODE} MATCHES "HOSTTOOLS|CROSSCOMPILE")

Expand Down