Skip to content

Commit 523312e

Browse files
committed
Use find_package instead of include.
rdar://27062396
1 parent 1ad6667 commit 523312e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cmake/modules/SwiftSharedCMakeConfig.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ macro(swift_common_standalone_build_config_llvm product is_cross_compiling)
3434

3535
# Then we import LLVMConfig. This is going to override whatever cached value
3636
# we have for LLVM_ENABLE_ASSERTIONS.
37-
include(LLVMConfig)
37+
find_package(LLVM REQUIRED CONFIG
38+
HINTS "${PATH_TO_LLVM_BUILD}" NO_DEFAULT_PATH)
3839

3940
# If we did not have a cached value for LLVM_ENABLE_ASSERTIONS, set
4041
# LLVM_ENABLE_ASSERTIONS_saved to be the ENABLE_ASSERTIONS value from LLVM so
@@ -128,10 +129,9 @@ macro(swift_common_standalone_build_config_clang product is_cross_compiling)
128129
list(APPEND CMAKE_MODULE_PATH ${path})
129130
endforeach()
130131

131-
# Then include ClangTargets.cmake. If Clang adds a ClangConfig.cmake, this is
132-
# where it will be included. By including ClangTargets.cmake, we at least get
133-
# the right dependency ordering for clang libraries.
134-
include(ClangTargets)
132+
# Then include Clang.
133+
find_package(Clang REQUIRED CONFIG
134+
HINTS "${PATH_TO_CLANG_BUILD}" NO_DEFAULT_PATH)
135135

136136
if(NOT EXISTS "${PATH_TO_CLANG_SOURCE}/include/clang/AST/Decl.h")
137137
message(FATAL_ERROR "Please set ${product}_PATH_TO_CLANG_SOURCE to the root directory of Clang's source code.")

0 commit comments

Comments
 (0)