Skip to content

Commit 3168df8

Browse files
committed
[cmake] Do not set CMAKE_INCLUDE_CURRENT_DIR.
Setting this value is equivalent to setting: include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) in all subdirectories. Since these are all macros, this means that we are adding to the configuration path the root swift directory. There is no reason to do this and will result in confusion/bugs in the future. rdar://26154980
1 parent 242fa0c commit 3168df8

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

cmake/modules/SwiftSharedCMakeConfig.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ macro(swift_common_standalone_build_config_llvm product is_cross_compiling)
8484
"${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}" CACHE STRING
8585
"Version number that will be placed into the libclang library , in the form XX.YY")
8686

87-
set(CMAKE_INCLUDE_CURRENT_DIR ON)
8887
include_directories("${PATH_TO_LLVM_BUILD}/include"
8988
"${LLVM_MAIN_INCLUDE_DIR}")
9089
foreach (INCLUDE_DIR ${LLVM_INCLUDE_DIRS})

lib/ClangImporter/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@ add_swift_library(swiftClangImporter STATIC
2323
swiftParse
2424
)
2525

26+
# Include the current binary dir since we rely on gybed files.
27+
include_directories(${CMAKE_CURRENT_BINARY_DIR})
2628

2729
add_dependencies(swiftClangImporter "${generated_include_targets}")

tools/SourceKit/tools/sourcekitd-test/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
set(LLVM_TARGET_DEFINITIONS Options.td)
22
swift_tablegen(Options.inc -gen-opt-parser-defs)
33
swift_add_public_tablegen_target(sourcekitdTestOptionsTableGen)
4+
# Add this directories binary directory to the include list to make sure that we
5+
# can properly include Options.inc.
6+
include_directories(${CMAKE_CURRENT_BINARY_DIR})
47

58
if(SWIFT_SOURCEKIT_USE_INPROC_LIBRARY)
69
set(SOURCEKITD_TEST_DEPEND sourcekitdInProc)

0 commit comments

Comments
 (0)