Skip to content

Commit 86642fa

Browse files
authored
Merge pull request #61683 from ahoppen/ahoppen/fix-tooling-libs-build
[CMake] Fix issues when running `build-tooling-libs`
2 parents 4c546d3 + d6bcfd9 commit 86642fa

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

SwiftCompilerSources/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,10 @@ function(add_swift_compiler_modules_library name)
127127
${SWIFT_HOST_VARIANT_ARCH} "${deployment_version}")
128128

129129
# Let Swift discover SwiftShims headers which are included by some headers
130-
# under `include/swift`.
130+
# under `include/swift`. These are either located next to the compiler (in case of open source toolchains) or
131+
# in the SDK (in case a Swift compiler from Xcode)
131132
get_filename_component(swift_exec_bin_dir ${ALS_SWIFT_EXEC} DIRECTORY)
132-
set(sdk_option ${sdk_option} "-I" "${swift_exec_bin_dir}/../lib")
133+
set(sdk_option ${sdk_option} "-I" "${swift_exec_bin_dir}/../lib" "-I" "${sdk_path}/usr/lib")
133134

134135
set(all_obj_files)
135136
set(all_module_targets)

cmake/modules/SwiftSharedCMakeConfig.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@ macro(swift_common_unified_build_config product)
274274
set(${product}_NATIVE_CLANG_TOOLS_PATH "${CMAKE_BINARY_DIR}/bin")
275275
set(LLVM_PACKAGE_VERSION ${PACKAGE_VERSION})
276276
set(LLVM_CMAKE_DIR "${CMAKE_SOURCE_DIR}/cmake/modules")
277+
set(CLANG_INCLUDE_DIRS
278+
"${CLANG_MAIN_INCLUDE_DIR}"
279+
"${CLANG_BUILD_INCLUDE_DIR}"
280+
)
277281

278282
# If cmark was checked out into tools/cmark, expect to build it as
279283
# part of the unified build.

lib/AST/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ endif()
179179
# where intrinsics and attributes are declared. swiftAST depends on these
180180
# headers.
181181
# For more information see the comment at the top of lib/CMakeLists.txt.
182-
add_dependencies(swiftAST intrinsics_gen clang-tablegen-targets)
182+
add_dependencies(swift-ast-generated-headers intrinsics_gen clang-tablegen-targets)
183183
add_dependencies(swiftAST swift-ast-generated-headers)
184184

185185
set_swift_llvm_is_available(swiftAST)

0 commit comments

Comments
 (0)