[PATCH] [asan] Install asan_device_setup to bin/ when targetting Android
Evgeniy Stepanov
eugenis at google.com
Thu Feb 27 00:20:29 PST 2014
Hi samsonov,
http://llvm-reviews.chandlerc.com/D2887
CHANGE SINCE LAST DIFF
http://llvm-reviews.chandlerc.com/D2887?vs=7372&id=7388#toc
Files:
cmake/Modules/AddCompilerRT.cmake
lib/asan/CMakeLists.txt
lib/asan/scripts/CMakeLists.txt
CMakeLists.txt
Index: cmake/Modules/AddCompilerRT.cmake
===================================================================
--- cmake/Modules/AddCompilerRT.cmake
+++ cmake/Modules/AddCompilerRT.cmake
@@ -144,3 +144,16 @@
# Install in Clang resource directory.
install(FILES ${file_name} DESTINATION ${COMPILER_RT_INSTALL_PATH})
endmacro()
+
+macro(add_compiler_rt_script name)
+ set(dst ${COMPILER_RT_EXEC_OUTPUT_DIR}/${name})
+ set(src ${CMAKE_CURRENT_SOURCE_DIR}/${name})
+ add_custom_command(OUTPUT ${dst}
+ DEPENDS ${src}
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
+ COMMENT "Copying ${name}...")
+ add_custom_target(${name} DEPENDS ${dst})
+ install(FILES ${dst}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/bin)
+endmacro(add_compiler_rt_script src name)
Index: lib/asan/CMakeLists.txt
===================================================================
--- lib/asan/CMakeLists.txt
+++ lib/asan/CMakeLists.txt
@@ -135,6 +135,8 @@
add_dependencies(asan asan_blacklist)
add_dependencies(compiler-rt asan)
+add_subdirectory(scripts)
+
if(COMPILER_RT_INCLUDE_TESTS)
add_subdirectory(tests)
endif()
Index: lib/asan/scripts/CMakeLists.txt
===================================================================
--- lib/asan/scripts/CMakeLists.txt
+++ lib/asan/scripts/CMakeLists.txt
@@ -0,0 +1,4 @@
+if(ANDROID)
+ add_compiler_rt_script(asan_device_setup)
+ add_dependencies(asan asan_device_setup)
+endif()
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -37,6 +37,7 @@
${PACKAGE_VERSION})
# Setup the paths where compiler-rt runtimes and headers should be stored.
set(COMPILER_RT_OUTPUT_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION})
+ set(COMPILER_RT_EXEC_OUTPUT_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
set(COMPILER_RT_INSTALL_PATH lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests."
${LLVM_INCLUDE_TESTS})
@@ -49,6 +50,8 @@
# Take output dir and install path from the user.
set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH
"Path where built compiler-rt libraries should be stored.")
+ set(COMPILER_RT_EXEC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin CACHE PATH
+ "Path where built compiler-rt executables should be stored.")
set(COMPILER_RT_INSTALL_PATH ${CMAKE_INSTALL_PREFIX} CACHE PATH
"Path where built compiler-rt libraries should be installed.")
option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." OFF)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2887.2.patch
Type: text/x-patch
Size: 2714 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140227/9d477922/attachment.bin>
More information about the llvm-commits
mailing list