Skip to content

Commit 5807d94

Browse files
committed
[CMake] Get Clang directory from CLANG_INSTALL_PREFIX
If Clang was installed standalone (in particular, not in the LLVM tree), use the CLANG_INSTALL_PREFIX variable to indicate where it is. Actually, we can always use `CLANG_INSTALL_PREFIX`. It's defined by `ClangConfig.cmake`. We should also need to take into account `LLVM_LIBDIR_SUFFIX`.
1 parent 36370d0 commit 5807d94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/clingutils/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ if (builtin_clang)
8585
set(CLANG_RESOURCE_DIR_STEM ${CMAKE_BINARY_DIR}/interpreter/llvm-project/llvm/${CMAKE_CFG_INTDIR}/lib/clang)
8686
set(CLANG_RESOURCE_DIR_VERSION ${LLVM_VERSION_MAJOR})
8787
else ()
88-
set(CLANG_RESOURCE_DIR_STEM ${LLVM_LIBRARY_DIR}/clang)
88+
set(CLANG_RESOURCE_DIR_STEM ${CLANG_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}/clang)
8989
# A user can define a clang version to use, otherwise find it (but will error if more than one version is present)
9090
if (NOT DEFINED CLANG_RESOURCE_DIR_VERSION)
9191
if (NOT EXISTS ${CLANG_RESOURCE_DIR_STEM})

0 commit comments

Comments
 (0)