Chandler Carruth | b0d8671 | 2012-06-21 01:30:21 +0000 | [diff] [blame] | 1 | set( LLVM_LINK_COMPONENTS |
| 2 | ${LLVM_TARGETS_TO_BUILD} |
| 3 | asmparser |
| 4 | bitreader |
| 5 | bitwriter |
| 6 | codegen |
| 7 | instrumentation |
| 8 | ipo |
| 9 | linker |
| 10 | selectiondag |
| 11 | ) |
| 12 | |
| 13 | add_clang_executable(clang |
| 14 | driver.cpp |
| 15 | cc1_main.cpp |
| 16 | cc1as_main.cpp |
| 17 | ) |
| 18 | |
| 19 | target_link_libraries(clang |
Peter Collingbourne | 22a7dfe | 2011-10-30 17:30:44 +0000 | [diff] [blame] | 20 | clangFrontendTool |
Jeffrey Yasskin | 0a86d44 | 2011-02-11 23:46:38 +0000 | [diff] [blame] | 21 | clangAST |
| 22 | clangAnalysis |
| 23 | clangBasic |
Daniel Dunbar | 2108577 | 2009-12-11 22:20:12 +0000 | [diff] [blame] | 24 | clangCodeGen |
Jeffrey Yasskin | 0a86d44 | 2011-02-11 23:46:38 +0000 | [diff] [blame] | 25 | clangDriver |
Ted Kremenek | 30660a8 | 2012-03-06 20:06:33 +0000 | [diff] [blame] | 26 | clangEdit |
Jeffrey Yasskin | 0a86d44 | 2011-02-11 23:46:38 +0000 | [diff] [blame] | 27 | clangFrontend |
Jeffrey Yasskin | 0a86d44 | 2011-02-11 23:46:38 +0000 | [diff] [blame] | 28 | clangLex |
John McCall | 1951085 | 2010-08-20 18:27:03 +0000 | [diff] [blame] | 29 | clangParse |
Ted Kremenek | 30660a8 | 2012-03-06 20:06:33 +0000 | [diff] [blame] | 30 | clangEdit |
John McCall | 8f0e8d2 | 2011-06-15 23:25:17 +0000 | [diff] [blame] | 31 | clangARCMigrate |
Ted Kremenek | 305c613 | 2012-09-01 05:09:24 +0000 | [diff] [blame] | 32 | clangRewriteCore |
| 33 | clangRewriteFrontend |
Chandler Carruth | e89d1d5 | 2010-01-29 10:03:42 +0000 | [diff] [blame] | 34 | clangSema |
Jeffrey Yasskin | 0a86d44 | 2011-02-11 23:46:38 +0000 | [diff] [blame] | 35 | clangSerialization |
Argyrios Kyrtzidis | e817771 | 2011-02-14 18:13:01 +0000 | [diff] [blame] | 36 | clangStaticAnalyzerFrontend |
Ted Kremenek | 2114258 | 2010-12-23 19:38:26 +0000 | [diff] [blame] | 37 | clangStaticAnalyzerCheckers |
| 38 | clangStaticAnalyzerCore |
Daniel Dunbar | cbcd98b | 2009-03-24 02:52:57 +0000 | [diff] [blame] | 39 | ) |
| 40 | |
Douglas Gregor | 8435bf9 | 2011-02-25 19:24:02 +0000 | [diff] [blame] | 41 | set_target_properties(clang PROPERTIES VERSION ${CLANG_EXECUTABLE_VERSION}) |
| 42 | |
NAKAMURA Takumi | 675a4e1 | 2012-07-20 16:40:09 +0000 | [diff] [blame] | 43 | add_dependencies(clang clang-headers) |
| 44 | |
Douglas Gregor | 6cef99d | 2009-11-19 16:42:34 +0000 | [diff] [blame] | 45 | if(UNIX) |
| 46 | set(CLANGXX_LINK_OR_COPY create_symlink) |
Dylan Noblesmith | 3d9000d | 2012-02-09 20:02:46 +0000 | [diff] [blame] | 47 | # Create a relative symlink |
| 48 | set(clang_binary "clang${CMAKE_EXECUTABLE_SUFFIX}") |
Douglas Gregor | 6cef99d | 2009-11-19 16:42:34 +0000 | [diff] [blame] | 49 | else() |
| 50 | set(CLANGXX_LINK_OR_COPY copy) |
Dylan Noblesmith | 3d9000d | 2012-02-09 20:02:46 +0000 | [diff] [blame] | 51 | set(clang_binary "${LLVM_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/clang${CMAKE_EXECUTABLE_SUFFIX}") |
Douglas Gregor | 6cef99d | 2009-11-19 16:42:34 +0000 | [diff] [blame] | 52 | endif() |
| 53 | |
Douglas Gregor | c720a4d | 2009-11-19 05:46:45 +0000 | [diff] [blame] | 54 | # Create the clang++ symlink in the build directory. |
Oscar Fuentes | aadd04c | 2011-02-06 15:33:08 +0000 | [diff] [blame] | 55 | set(clang_pp "${LLVM_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/clang++${CMAKE_EXECUTABLE_SUFFIX}") |
Peter Collingbourne | 82c3460 | 2011-11-21 00:00:48 +0000 | [diff] [blame] | 56 | add_custom_command(TARGET clang POST_BUILD |
Dylan Noblesmith | 3d9000d | 2012-02-09 20:02:46 +0000 | [diff] [blame] | 57 | COMMAND ${CMAKE_COMMAND} -E ${CLANGXX_LINK_OR_COPY} "${clang_binary}" "${clang_pp}") |
Douglas Gregor | 8435bf9 | 2011-02-25 19:24:02 +0000 | [diff] [blame] | 58 | |
Oscar Fuentes | 839e61a | 2011-02-05 21:37:37 +0000 | [diff] [blame] | 59 | set_property(DIRECTORY APPEND |
| 60 | PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${clang_pp}) |
Douglas Gregor | c720a4d | 2009-11-19 05:46:45 +0000 | [diff] [blame] | 61 | |
Douglas Gregor | 7f7b748 | 2009-08-23 05:28:29 +0000 | [diff] [blame] | 62 | install(TARGETS clang |
| 63 | RUNTIME DESTINATION bin) |
Douglas Gregor | c720a4d | 2009-11-19 05:46:45 +0000 | [diff] [blame] | 64 | |
| 65 | # Create the clang++ symlink at installation time. |
Oscar Fuentes | fbfe899 | 2010-10-17 16:10:32 +0000 | [diff] [blame] | 66 | install(SCRIPT clang_symlink.cmake -DCMAKE_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\") |