[libcxx] [test] Fix restoring LLVM_DIR and Clang_DIR (#132838) · llvm/llvm-project@44a6f6a (original) (raw)

File tree

1 file changed

lines changed

1 file changed

lines changed

Original file line number Diff line number Diff line change
@@ -8,6 +8,10 @@ set(Clang_DIR_SAVE ${Clang_DIR})
8 8 # versions must match. Otherwise there likely will be ODR-violations. This had
9 9 # led to crashes and incorrect output of the clang-tidy based checks.
10 10 find_package(Clang ${CMAKE_CXX_COMPILER_VERSION})
11 +
12 +set(LLVM_DIR "${LLVM_DIR_SAVE}" CACHE PATH "The directory containing a CMake configuration file for LLVM." FORCE)
13 +set(Clang_DIR "${Clang_DIR_SAVE}" CACHE PATH "The directory containing a CMake configuration file for Clang." FORCE)
14 +
11 15 if(NOT Clang_FOUND)
12 16 message(STATUS "Clang-tidy tests are disabled since the "
13 17 "Clang development package is unavailable.")
@@ -19,9 +23,6 @@ if(NOT TARGET clangTidy)
19 23 return()
20 24 endif()
21 25
22 -set(LLVM_DIR "${LLVM_DIR_SAVE}" CACHE PATH "The directory containing a CMake configuration file for LLVM." FORCE)
23 -set(Clang_DIR "${Clang_DIR_SAVE}" CACHE PATH "The directory containing a CMake configuration file for Clang." FORCE)
24 -
25 26 message(STATUS "Found system-installed LLVM LLVMPACKAGEVERSIONwithheadersin{LLVM_PACKAGE_VERSION} with headers in LLVMPACKAGEVERSIONwithheadersin{LLVM_INCLUDE_DIRS}")
26 27
27 28 set(CMAKE_CXX_STANDARD 20)