Skip to content

Commit b9e2f7a

Browse files
authored
[libclc] Change libclc install dir to ${clang_resource_dir}/lib/libclc in in-tree build (#163896)
Commit df74736 placed libclc libraries into clang resource dir <resource-dir>/lib/libclc at build stage. This PR does it at install stage as well. Note that in standalone (not in-tree) build, libclc is still installed to old ${CMAKE_INSTALL_DATADIR}/clc dir.
1 parent 3f9f522 commit b9e2f7a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

libclc/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ if( LIBCLC_STANDALONE_BUILD OR CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DI
7777

7878
# Setup the paths where libclc runtimes should be stored.
7979
set( LIBCLC_OUTPUT_LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR} )
80+
set( LIBCLC_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/clc )
8081
else()
8182
# In-tree configuration
8283
set( LIBCLC_STANDALONE_BUILD FALSE )
@@ -100,10 +101,12 @@ else()
100101
# Setup the paths where libclc runtimes should be stored. By default, in an
101102
# in-tree build we place the libraries in clang's resource driectory.
102103
include(GetClangResourceDir)
103-
get_clang_resource_dir( LIBCLC_OUTPUT_DIR PREFIX ${LLVM_LIBRARY_OUTPUT_INTDIR}/.. )
104+
get_clang_resource_dir( LIBCLC_INSTALL_DIR )
105+
cmake_path( APPEND LIBCLC_INSTALL_DIR "lib" "libclc" )
104106

105107
# Note we do not adhere to LLVM_ENABLE_PER_TARGET_RUNTIME_DIR.
106-
set( LIBCLC_OUTPUT_LIBRARY_DIR ${LIBCLC_OUTPUT_DIR}/lib/libclc )
108+
cmake_path( GET LLVM_LIBRARY_OUTPUT_INTDIR PARENT_PATH LIBCLC_OUTPUT_LIBRARY_DIR )
109+
cmake_path( APPEND LIBCLC_OUTPUT_LIBRARY_DIR ${LIBCLC_INSTALL_DIR} )
107110
file( MAKE_DIRECTORY ${LIBCLC_OUTPUT_LIBRARY_DIR} )
108111
endif()
109112

libclc/cmake/modules/AddLibclc.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ function(libclc_install)
261261

262262
install(
263263
FILES ${files}
264-
DESTINATION "${CMAKE_INSTALL_DATADIR}/clc"
264+
DESTINATION ${LIBCLC_INSTALL_DIR}
265265
)
266266
endfunction()
267267

0 commit comments

Comments
 (0)