[compiler-rt] r322451 - Reland "Install resource files into a share/ directory"

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 13 19:43:15 PST 2018


Author: phosek
Date: Sat Jan 13 19:43:14 2018
New Revision: 322451

URL: http://llvm.org/viewvc/llvm-project?rev=322451&view=rev
Log:
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

Modified:
    compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
    compiler-rt/trunk/lib/dfsan/CMakeLists.txt

Modified: compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake?rev=322451&r1=322450&r2=322451&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake Sat Jan 13 19:43:14 2018
@@ -431,7 +431,7 @@ endfunction()
 
 macro(add_compiler_rt_resource_file target_name file_name component)
   set(src_file "${CMAKE_CURRENT_SOURCE_DIR}/${file_name}")
-  set(dst_file "${COMPILER_RT_OUTPUT_DIR}/${file_name}")
+  set(dst_file "${COMPILER_RT_OUTPUT_DIR}/share/${file_name}")
   add_custom_command(OUTPUT ${dst_file}
     DEPENDS ${src_file}
     COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src_file} ${dst_file}
@@ -439,7 +439,7 @@ macro(add_compiler_rt_resource_file targ
   add_custom_target(${target_name} DEPENDS ${dst_file})
   # Install in Clang resource directory.
   install(FILES ${file_name}
-    DESTINATION ${COMPILER_RT_INSTALL_PATH}
+    DESTINATION ${COMPILER_RT_INSTALL_PATH}/share
     COMPONENT ${component})
   add_dependencies(${component} ${target_name})
 

Modified: compiler-rt/trunk/lib/dfsan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/dfsan/CMakeLists.txt?rev=322451&r1=322450&r2=322451&view=diff
==============================================================================
--- compiler-rt/trunk/lib/dfsan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/dfsan/CMakeLists.txt Sat Jan 13 19:43:14 2018
@@ -32,16 +32,19 @@ foreach(arch ${DFSAN_SUPPORTED_ARCH})
     clang_rt.dfsan-${arch}-symbols)
 endforeach()
 
-set(dfsan_abilist_filename ${COMPILER_RT_OUTPUT_DIR}/dfsan_abilist.txt)
+set(dfsan_abilist_dir ${COMPILER_RT_OUTPUT_DIR}/share)
+set(dfsan_abilist_filename ${dfsan_abilist_dir}/dfsan_abilist.txt)
 add_custom_target(dfsan_abilist ALL
   DEPENDS ${dfsan_abilist_filename})
 add_custom_command(OUTPUT ${dfsan_abilist_filename}
                    VERBATIM
                    COMMAND
+                    ${CMAKE_COMMAND} -E make_directory ${dfsan_abilist_dir}
+                   COMMAND
                      cat ${CMAKE_CURRENT_SOURCE_DIR}/done_abilist.txt
                          ${CMAKE_CURRENT_SOURCE_DIR}/libc_ubuntu1404_abilist.txt
                          > ${dfsan_abilist_filename}
                    DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt)
 add_dependencies(dfsan dfsan_abilist)
 install(FILES ${dfsan_abilist_filename}
-        DESTINATION ${COMPILER_RT_INSTALL_PATH})
+        DESTINATION ${COMPILER_RT_INSTALL_PATH}/share)




More information about the llvm-commits mailing list