https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/201816
If we configure llvm from llvm-project/build folder, find_package(LLVM) succeeds, `LLVM_LIBRARY_OUTPUT_INTDIR` is `build/./lib` and `LLVM_BINARY_DIR` is `build`. However, in #201773, find_package(LLVM) fails due to LLVM_LIBDIR_SUFFIX=64, LLVM_LIBRARY_OUTPUT_INTDIR is `redhat-linux-build/runtimes/runtimes-nvptx64-nvidia-cuda-bins/lib64` and LLVM_BINARY_DIR is `redhat-linux-build`. Use LLVM_BINARY_DIR, which is stable for both cases, for libclc output dir. >From 91368e04944fae5f93a7df3ddc52efd0fc0fd6ef Mon Sep 17 00:00:00 2001 From: Wenju He <[email protected]> Date: Fri, 5 Jun 2026 13:46:04 +0200 Subject: [PATCH] [libclc] Fix LIBCLC_OUTPUT_LIBRARY_DIR when find_package(LLVM) fails If we configure llvm from llvm-project/build folder, find_package(LLVM) succeeds, `LLVM_LIBRARY_OUTPUT_INTDIR` is `build/./lib` and `LLVM_BINARY_DIR` is `build`. However, in #201773, find_package(LLVM) fails due to LLVM_LIBDIR_SUFFIX=64, LLVM_LIBRARY_OUTPUT_INTDIR is `redhat-linux-build/runtimes/runtimes-nvptx64-nvidia-cuda-bins/lib64` and LLVM_BINARY_DIR is `redhat-linux-build`. Use LLVM_BINARY_DIR, which is stable for both cases, for libclc output dir. --- libclc/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt index 94ec63c89ff0a..bc3624688a087 100644 --- a/libclc/CMakeLists.txt +++ b/libclc/CMakeLists.txt @@ -83,9 +83,9 @@ else() include(GetClangResourceDir) get_clang_resource_dir( LIBCLC_INSTALL_DIR ) cmake_path( APPEND LIBCLC_INSTALL_DIR "lib" ) - - cmake_path( GET LLVM_LIBRARY_OUTPUT_INTDIR PARENT_PATH LIBCLC_OUTPUT_LIBRARY_DIR ) - cmake_path( APPEND LIBCLC_OUTPUT_LIBRARY_DIR ${LIBCLC_INSTALL_DIR} ) + cmake_path( APPEND LLVM_BINARY_DIR ${LIBCLC_INSTALL_DIR} + OUTPUT_VARIABLE LIBCLC_OUTPUT_LIBRARY_DIR + ) endif() if( NOT LIBCLC_USE_SPIRV_BACKEND ) _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
