Skip to content

Commit 77cfaca

Browse files
committedJan 14, 2018
Reland "Install resource files into a share/ directory"
Currently these files are being installed into a root installation directory, but this triggers an error when the installation directory is set to an empty string which is often the case when DESTDIR is used to control the installation destination. Differential Revision: https://reviews.llvm.org/D41673 llvm-svn: 322451
1 parent e9fc0cd commit 77cfaca

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed
 

‎compiler-rt/cmake/Modules/AddCompilerRT.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -431,15 +431,15 @@ endfunction()
431431

432432
macro(add_compiler_rt_resource_file target_name file_name component)
433433
set(src_file "${CMAKE_CURRENT_SOURCE_DIR}/${file_name}")
434-
set(dst_file "${COMPILER_RT_OUTPUT_DIR}/${file_name}")
434+
set(dst_file "${COMPILER_RT_OUTPUT_DIR}/share/${file_name}")
435435
add_custom_command(OUTPUT ${dst_file}
436436
DEPENDS ${src_file}
437437
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src_file} ${dst_file}
438438
COMMENT "Copying ${file_name}...")
439439
add_custom_target(${target_name} DEPENDS ${dst_file})
440440
# Install in Clang resource directory.
441441
install(FILES ${file_name}
442-
DESTINATION ${COMPILER_RT_INSTALL_PATH}
442+
DESTINATION ${COMPILER_RT_INSTALL_PATH}/share
443443
COMPONENT ${component})
444444
add_dependencies(${component} ${target_name})
445445

‎compiler-rt/lib/dfsan/CMakeLists.txt

+5-2
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,19 @@ foreach(arch ${DFSAN_SUPPORTED_ARCH})
3232
clang_rt.dfsan-${arch}-symbols)
3333
endforeach()
3434

35-
set(dfsan_abilist_filename ${COMPILER_RT_OUTPUT_DIR}/dfsan_abilist.txt)
35+
set(dfsan_abilist_dir ${COMPILER_RT_OUTPUT_DIR}/share)
36+
set(dfsan_abilist_filename ${dfsan_abilist_dir}/dfsan_abilist.txt)
3637
add_custom_target(dfsan_abilist ALL
3738
DEPENDS ${dfsan_abilist_filename})
3839
add_custom_command(OUTPUT ${dfsan_abilist_filename}
3940
VERBATIM
41+
COMMAND
42+
${CMAKE_COMMAND} -E make_directory ${dfsan_abilist_dir}
4043
COMMAND
4144
cat ${CMAKE_CURRENT_SOURCE_DIR}/done_abilist.txt
4245
${CMAKE_CURRENT_SOURCE_DIR}/libc_ubuntu1404_abilist.txt
4346
> ${dfsan_abilist_filename}
4447
DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt)
4548
add_dependencies(dfsan dfsan_abilist)
4649
install(FILES ${dfsan_abilist_filename}
47-
DESTINATION ${COMPILER_RT_INSTALL_PATH})
50+
DESTINATION ${COMPILER_RT_INSTALL_PATH}/share)

0 commit comments

Comments
 (0)
Please sign in to comment.