Skip to content

Commit c291328

Browse files
mgornyusama54321
authored andcommitted
[clang] [cmake] Add cmake module dir before using GetDarwinLinkerVersion (llvm#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 7b8e634 commit c291328

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

clang/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
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

@@ -140,13 +147,6 @@ if(CLANG_BUILT_STANDALONE)
140147
endif() # LLVM_INCLUDE_TESTS
141148
endif() # standalone
142149

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

0 commit comments

Comments
 (0)