[libclc] eb17a2e - [libclc] Make sure PACKAGE_VERSION is set for libclc (#193966)

via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 24 08:41:33 PDT 2026


Author: Joseph Huber
Date: 2026-04-24T10:41:28-05:00
New Revision: eb17a2e19c854b0f4f3018f3e17d70340a3eb45f

URL: https://github.com/llvm/llvm-project/commit/eb17a2e19c854b0f4f3018f3e17d70340a3eb45f
DIFF: https://github.com/llvm/llvm-project/commit/eb17a2e19c854b0f4f3018f3e17d70340a3eb45f.diff

LOG: [libclc] Make sure PACKAGE_VERSION is set for libclc (#193966)

Summary:
This can be unset because CMake does not expose this as a raw variable
when you use the find_package interface. If it is not set as in the case
of standalone builds the clang resource directory won't be found

Added: 
    

Modified: 
    libclc/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index 9ec1cfa79db09..f0405d164216c 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -69,6 +69,11 @@ else()
     message(FATAL_ERROR "Clang is not enabled, but is required to build libclc in-tree")
   endif()
 
+  # The package version is required to find the resource directory.
+  if( LLVM_PACKAGE_VERSION AND NOT PACKAGE_VERSION )
+    set( PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}" )
+  endif()
+
   get_host_tool_path( llvm-link LLVM_LINK llvm-link_exe llvm-link_target )
   get_host_tool_path( opt OPT opt_exe opt_target )
 


        


More information about the cfe-commits mailing list