Skip to content

Commit e14c6fa

Browse files
authored
[clang] [cmake] Add cmake module dir before using GetDarwinLinkerVersion (#86386)
Move the code adding top-level cmake/Modules directory to CMAKE_MODULE_PATH prior to including `GetDarwinLinkerVersion`, in order to fix standalone builds. Fixes a regression introduced by 3bc71c2.
1 parent 39c8e87 commit e14c6fa

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

clang/CMakeLists.txt

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
1313
set(CLANG_BUILT_STANDALONE TRUE)
1414
endif()
1515

16+
# Make sure that our source directory is on the current cmake module path so that
17+
# we can include cmake files from this directory.
18+
list(INSERT CMAKE_MODULE_PATH 0
19+
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
20+
"${LLVM_COMMON_CMAKE_UTILS}/Modules"
21+
)
22+
1623
# Must go below project(..)
1724
include(GNUInstallDirs)
1825
include(GetDarwinLinkerVersion)
@@ -141,13 +148,6 @@ if(CLANG_BUILT_STANDALONE)
141148
endif() # LLVM_INCLUDE_TESTS
142149
endif() # standalone
143150

144-
# Make sure that our source directory is on the current cmake module path so that
145-
# we can include cmake files from this directory.
146-
list(INSERT CMAKE_MODULE_PATH 0
147-
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
148-
"${LLVM_COMMON_CMAKE_UTILS}/Modules"
149-
)
150-
151151
# This allows disabling clang's XML dependency even if LLVM finds libxml2.
152152
# By default, clang depends on libxml2 if LLVM does.
153153
option(CLANG_ENABLE_LIBXML2 "Whether libclang may depend on libxml2"

0 commit comments

Comments
 (0)