[PATCH] CMake: support the LLVM_INSTALL_TOOLCHAIN_ONLY flag
Hans Wennborg
hans at chromium.org
Fri Aug 23 15:53:49 PDT 2013
Hi rnk,
This is the Clang-side of http://llvm-reviews.chandlerc.com/D1428
http://llvm-reviews.chandlerc.com/D1498
Files:
CMakeLists.txt
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -237,10 +237,13 @@
target_link_libraries( ${name} ${LLVM_COMMON_LIBS} )
link_system_libs( ${name} )
- install(TARGETS ${name}
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
- RUNTIME DESTINATION bin)
+ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libclang")
+ install(TARGETS ${name}
+ LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+ ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+ RUNTIME DESTINATION bin)
+ endif()
+
set_target_properties(${name} PROPERTIES FOLDER "Clang libraries")
endmacro(add_clang_library)
@@ -254,22 +257,31 @@
${CMAKE_CURRENT_SOURCE_DIR}/include
)
-install(DIRECTORY include/
+if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
+ install(DIRECTORY include/
+ DESTINATION include
+ FILES_MATCHING
+ PATTERN "*.def"
+ PATTERN "*.h"
+ PATTERN "config.h" EXCLUDE
+ PATTERN ".svn" EXCLUDE
+ )
+
+ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/
+ DESTINATION include
+ FILES_MATCHING
+ PATTERN "CMakeFiles" EXCLUDE
+ PATTERN "*.inc"
+ )
+endif()
+
+install(DIRECTORY include/clang-c
DESTINATION include
FILES_MATCHING
- PATTERN "*.def"
PATTERN "*.h"
- PATTERN "config.h" EXCLUDE
PATTERN ".svn" EXCLUDE
)
-install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/
- DESTINATION include
- FILES_MATCHING
- PATTERN "CMakeFiles" EXCLUDE
- PATTERN "*.inc"
- )
-
add_definitions( -D_GNU_SOURCE )
option(CLANG_ENABLE_ARCMT "Build ARCMT." ON)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1498.1.patch
Type: text/x-patch
Size: 1652 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130823/6fb6e216/attachment.bin>
More information about the cfe-commits
mailing list