diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-01-29 11:46:06 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-01-29 11:46:06 +0000 |
commit | c9db3b8b396825d7b97f6a2a2e0f3dad7de07693 (patch) | |
tree | b9cdf5ff0de29e9ba29f78d40d82acb6ce57accc /compiler-rt | |
parent | bbc8415fda092475246cc36219c05576e8e098c1 (diff) | |
download | bcm5719-llvm-c9db3b8b396825d7b97f6a2a2e0f3dad7de07693.tar.gz bcm5719-llvm-c9db3b8b396825d7b97f6a2a2e0f3dad7de07693.zip |
[sanitizer] Copy sanitizer headers to the build tree.
llvm-svn: 173794
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/CMakeLists.txt | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt index 66f5859d6a1..bd4295eb8d8 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -149,6 +149,39 @@ endif() filter_available_targets(SANITIZER_COMMON_SUPPORTED_ARCH x86_64 i386 powerpc64 powerpc) +file(GLOB_RECURSE COMPILER_RT_HEADERS + RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/include" + "include/*.h") + +set(output_dir ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include) + +if(MSVC_IDE OR XCODE) + set(other_output_dir ${LLVM_BINARY_DIR}/bin/lib/clang/${CLANG_VERSION}/include) +endif() + +# Copy compiler-rt headers to the build tree. +set(out_files) +foreach( f ${COMPILER_RT_HEADERS} ) + set( src ${CMAKE_CURRENT_SOURCE_DIR}/include/${f} ) + set( dst ${output_dir}/${f} ) + add_custom_command(OUTPUT ${dst} + DEPENDS ${src} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst} + COMMENT "Copying compiler-rt's ${f}...") + list(APPEND out_files ${dst}) + + if(other_output_dir) + set(other_dst ${other_output_dir}/${f}) + add_custom_command(OUTPUT ${other_dst} + DEPENDS ${src} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${other_dst} + COMMENT "Copying compiler-rt's ${f}...") + list(APPEND out_files ${other_dst}) + endif() +endforeach( f ) + +add_custom_target(compiler-rt-headers ALL DEPENDS ${out_files}) + # Install compiler-rt headers. install(DIRECTORY include/ DESTINATION ${LIBCLANG_INSTALL_PATH}/include |