| Michael J. Spencer | 0947621 | 2010-09-13 23:54:41 +0000 | [diff] [blame] | 1 | set( LLVM_USED_LIBS |
| Peter Collingbourne | f1d76db | 2011-10-30 17:30:44 +0000 | [diff] [blame] | 2 | clangFrontendTool |
| Jeffrey Yasskin | c498878 | 2011-02-11 23:46:38 +0000 | [diff] [blame] | 3 | clangAST |
| 4 | clangAnalysis |
| 5 | clangBasic |
| Daniel Dunbar | f72bdf7 | 2009-12-11 22:20:12 +0000 | [diff] [blame] | 6 | clangCodeGen |
| Jeffrey Yasskin | c498878 | 2011-02-11 23:46:38 +0000 | [diff] [blame] | 7 | clangDriver |
| 8 | clangFrontend |
| Jeffrey Yasskin | c498878 | 2011-02-11 23:46:38 +0000 | [diff] [blame] | 9 | clangIndex |
| 10 | clangLex |
| John McCall | 8b0666c | 2010-08-20 18:27:03 +0000 | [diff] [blame] | 11 | clangParse |
| John McCall | d70fb98 | 2011-06-15 23:25:17 +0000 | [diff] [blame] | 12 | clangARCMigrate |
| Jeffrey Yasskin | c498878 | 2011-02-11 23:46:38 +0000 | [diff] [blame] | 13 | clangRewrite |
| Chandler Carruth | 7e6c0fc | 2010-01-29 10:03:42 +0000 | [diff] [blame] | 14 | clangSema |
| Jeffrey Yasskin | c498878 | 2011-02-11 23:46:38 +0000 | [diff] [blame] | 15 | clangSerialization |
| Argyrios Kyrtzidis | ecd3334 | 2011-02-14 18:13:01 +0000 | [diff] [blame] | 16 | clangStaticAnalyzerFrontend |
| Ted Kremenek | d99bd55 | 2010-12-23 19:38:26 +0000 | [diff] [blame] | 17 | clangStaticAnalyzerCheckers |
| 18 | clangStaticAnalyzerCore |
| Daniel Dunbar | 3db73ab | 2009-03-24 02:52:57 +0000 | [diff] [blame] | 19 | ) |
| 20 | |
| Michael J. Spencer | 0947621 | 2010-09-13 23:54:41 +0000 | [diff] [blame] | 21 | set( LLVM_LINK_COMPONENTS |
| 22 | ${LLVM_TARGETS_TO_BUILD} |
| 23 | asmparser |
| 24 | bitreader |
| 25 | bitwriter |
| 26 | codegen |
| Nick Lewycky | 207bce3 | 2011-04-21 23:44:07 +0000 | [diff] [blame] | 27 | instrumentation |
| Michael J. Spencer | 0947621 | 2010-09-13 23:54:41 +0000 | [diff] [blame] | 28 | ipo |
| Peter Collingbourne | f1d76db | 2011-10-30 17:30:44 +0000 | [diff] [blame] | 29 | linker |
| Michael J. Spencer | 0947621 | 2010-09-13 23:54:41 +0000 | [diff] [blame] | 30 | selectiondag |
| 31 | ) |
| 32 | |
| 33 | add_clang_executable(clang |
| 34 | driver.cpp |
| 35 | cc1_main.cpp |
| 36 | cc1as_main.cpp |
| 37 | ) |
| 38 | |
| Douglas Gregor | be8705b | 2011-02-25 19:24:02 +0000 | [diff] [blame] | 39 | set_target_properties(clang PROPERTIES VERSION ${CLANG_EXECUTABLE_VERSION}) |
| 40 | |
| Douglas Gregor | 45959e5 | 2009-11-19 16:42:34 +0000 | [diff] [blame] | 41 | if(UNIX) |
| 42 | set(CLANGXX_LINK_OR_COPY create_symlink) |
| Dylan Noblesmith | 9345813 | 2012-02-09 20:02:46 +0000 | [diff] [blame^] | 43 | # Create a relative symlink |
| 44 | set(clang_binary "clang${CMAKE_EXECUTABLE_SUFFIX}") |
| Douglas Gregor | 45959e5 | 2009-11-19 16:42:34 +0000 | [diff] [blame] | 45 | else() |
| 46 | set(CLANGXX_LINK_OR_COPY copy) |
| Dylan Noblesmith | 9345813 | 2012-02-09 20:02:46 +0000 | [diff] [blame^] | 47 | set(clang_binary "${LLVM_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/clang${CMAKE_EXECUTABLE_SUFFIX}") |
| Douglas Gregor | 45959e5 | 2009-11-19 16:42:34 +0000 | [diff] [blame] | 48 | endif() |
| 49 | |
| Douglas Gregor | 564d41f | 2009-11-19 05:46:45 +0000 | [diff] [blame] | 50 | # Create the clang++ symlink in the build directory. |
| Oscar Fuentes | ced8836 | 2011-02-06 15:33:08 +0000 | [diff] [blame] | 51 | set(clang_pp "${LLVM_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/clang++${CMAKE_EXECUTABLE_SUFFIX}") |
| Peter Collingbourne | 17a7bbb | 2011-11-21 00:00:48 +0000 | [diff] [blame] | 52 | add_custom_command(TARGET clang POST_BUILD |
| Dylan Noblesmith | 9345813 | 2012-02-09 20:02:46 +0000 | [diff] [blame^] | 53 | COMMAND ${CMAKE_COMMAND} -E ${CLANGXX_LINK_OR_COPY} "${clang_binary}" "${clang_pp}") |
| Douglas Gregor | be8705b | 2011-02-25 19:24:02 +0000 | [diff] [blame] | 54 | |
| Oscar Fuentes | 1b6a38e | 2011-02-05 21:37:37 +0000 | [diff] [blame] | 55 | set_property(DIRECTORY APPEND |
| 56 | PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${clang_pp}) |
| Douglas Gregor | 564d41f | 2009-11-19 05:46:45 +0000 | [diff] [blame] | 57 | |
| Douglas Gregor | 33870d9 | 2009-08-23 05:28:29 +0000 | [diff] [blame] | 58 | install(TARGETS clang |
| 59 | RUNTIME DESTINATION bin) |
| Douglas Gregor | 564d41f | 2009-11-19 05:46:45 +0000 | [diff] [blame] | 60 | |
| 61 | # Create the clang++ symlink at installation time. |
| Oscar Fuentes | 95b6f04 | 2010-10-17 16:10:32 +0000 | [diff] [blame] | 62 | install(SCRIPT clang_symlink.cmake -DCMAKE_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\") |