blob: c4320b0c905cd5edbcd21893aa53653a5f6fe1c6 [file] [log] [blame]
Mike Stumpa43a21e2009-03-24 17:52:34 +00001set(LLVM_NO_RTTI 1)
2
Daniel Dunbarcbcd98b2009-03-24 02:52:57 +00003set( LLVM_USED_LIBS
Daniel Dunbar21085772009-12-11 22:20:12 +00004 clangFrontend
Chandler Carruthe89d1d52010-01-29 10:03:42 +00005 clangDriver
Daniel Dunbar21085772009-12-11 22:20:12 +00006 clangCodeGen
Chandler Carruthe89d1d52010-01-29 10:03:42 +00007 clangSema
Ted Kremenek1309f9a2010-01-25 04:41:41 +00008 clangChecker
Daniel Dunbar21085772009-12-11 22:20:12 +00009 clangAnalysis
10 clangRewrite
Daniel Dunbar21085772009-12-11 22:20:12 +000011 clangAST
12 clangParse
13 clangLex
Daniel Dunbarcbcd98b2009-03-24 02:52:57 +000014 clangBasic
15 )
16
Daniel Dunbar21085772009-12-11 22:20:12 +000017set( LLVM_LINK_COMPONENTS
18 ${LLVM_TARGETS_TO_BUILD}
19 bitreader
20 bitwriter
21 codegen
22 ipo
23 selectiondag
24 )
Daniel Dunbarcbcd98b2009-03-24 02:52:57 +000025
Mike Stumpa43a21e2009-03-24 17:52:34 +000026add_clang_executable(clang
Daniel Dunbarcbcd98b2009-03-24 02:52:57 +000027 driver.cpp
Daniel Dunbar217acbf2009-11-19 07:37:51 +000028 cc1_main.cpp
Daniel Dunbarcbcd98b2009-03-24 02:52:57 +000029 )
Douglas Gregorfbc28362009-06-16 22:26:26 +000030
Douglas Gregor6cef99d2009-11-19 16:42:34 +000031if(UNIX)
32 set(CLANGXX_LINK_OR_COPY create_symlink)
33else()
34 set(CLANGXX_LINK_OR_COPY copy)
35endif()
36
Douglas Gregorc720a4d2009-11-19 05:46:45 +000037# Create the clang++ symlink in the build directory.
38add_custom_target(clang++ ALL
Douglas Gregor6cef99d2009-11-19 16:42:34 +000039 ${CMAKE_COMMAND} -E ${CLANGXX_LINK_OR_COPY}
Douglas Gregor234e1622009-11-19 07:59:29 +000040 "${LLVM_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/clang${CMAKE_EXECUTABLE_SUFFIX}"
41 "${LLVM_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/clang++${CMAKE_EXECUTABLE_SUFFIX}"
Douglas Gregorc720a4d2009-11-19 05:46:45 +000042 DEPENDS clang)
43
Douglas Gregor7f7b7482009-08-23 05:28:29 +000044install(TARGETS clang
45 RUNTIME DESTINATION bin)
Douglas Gregorc720a4d2009-11-19 05:46:45 +000046
47# Create the clang++ symlink at installation time.
Douglas Gregore83b4c12010-01-18 18:27:29 +000048install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E ${CLANGXX_LINK_OR_COPY} \"${CMAKE_INSTALL_PREFIX}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}\" \"\$ENV{DESTDIR}/\${CMAKE_INSTALL_PREFIX}/bin/clang++${CMAKE_EXECUTABLE_SUFFIX}\")")