Skip to content

Commit a6f87dd

Browse files
authored
Merge pull request #3309 from gottesmm/add_back_CMAKE_INCLUDE_CURRENT_DIR
Revert "[cmake] Do not set CMAKE_INCLUDE_CURRENT_DIR."
2 parents 95d4cbf + e25e0e4 commit a6f87dd

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,17 @@ if("${SWIFT_NATIVE_SWIFT_TOOLS_PATH}" STREQUAL "")
393393
set(SWIFT_NATIVE_SWIFT_TOOLS_PATH "${SWIFT_RUNTIME_OUTPUT_INTDIR}")
394394
endif()
395395

396+
# This setting causes all CMakeLists.txt to automatically have
397+
# ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CURRENT_SOURCE_DIR} as an
398+
# include_directories path. This is done for developer
399+
# convenience. Additionally, LLVM/Clang build with this option enabled, so we
400+
# should match them unless it is removed from LLVM/Clang as well.
401+
#
402+
# *NOTE* Even though these directories are added to the include path for a
403+
# specific CMakeLists.txt, these include paths are not propagated down to
404+
# subdirectories.
405+
set(CMAKE_INCLUDE_CURRENT_DIR ON)
406+
396407
# We'll need this once we have generated headers
397408
include_directories(BEFORE
398409
${CMAKE_CURRENT_BINARY_DIR}/include

lib/ClangImporter/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,5 @@ 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})
2826

2927
add_dependencies(swiftClangImporter "${generated_include_targets}")

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
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})
74

85
if(SWIFT_SOURCEKIT_USE_INPROC_LIBRARY)
96
set(SOURCEKITD_TEST_DEPEND sourcekitdInProc)

0 commit comments

Comments
 (0)