2010-09-14 07:54:41 +08:00
|
|
|
set( LLVM_USED_LIBS
|
2011-02-12 07:46:38 +08:00
|
|
|
clangAST
|
|
|
|
clangAnalysis
|
|
|
|
clangBasic
|
2009-12-12 06:20:12 +08:00
|
|
|
clangCodeGen
|
2011-02-12 07:46:38 +08:00
|
|
|
clangDriver
|
|
|
|
clangFrontend
|
|
|
|
clangFrontendTool
|
|
|
|
clangIndex
|
|
|
|
clangLex
|
2010-08-21 02:27:03 +08:00
|
|
|
clangParse
|
2011-02-12 07:46:38 +08:00
|
|
|
clangRewrite
|
2010-01-29 18:03:42 +08:00
|
|
|
clangSema
|
2011-02-12 07:46:38 +08:00
|
|
|
clangSerialization
|
2011-02-15 02:13:01 +08:00
|
|
|
clangStaticAnalyzerFrontend
|
2010-12-24 03:38:26 +08:00
|
|
|
clangStaticAnalyzerCheckers
|
|
|
|
clangStaticAnalyzerCore
|
2009-03-24 10:52:57 +08:00
|
|
|
)
|
|
|
|
|
2010-09-14 07:54:41 +08:00
|
|
|
set( LLVM_LINK_COMPONENTS
|
|
|
|
${LLVM_TARGETS_TO_BUILD}
|
|
|
|
asmparser
|
|
|
|
bitreader
|
|
|
|
bitwriter
|
|
|
|
codegen
|
2011-04-22 07:44:07 +08:00
|
|
|
instrumentation
|
2010-09-14 07:54:41 +08:00
|
|
|
ipo
|
|
|
|
selectiondag
|
|
|
|
)
|
|
|
|
|
|
|
|
add_clang_executable(clang
|
|
|
|
driver.cpp
|
|
|
|
cc1_main.cpp
|
|
|
|
cc1as_main.cpp
|
|
|
|
)
|
|
|
|
|
2011-02-26 03:24:02 +08:00
|
|
|
set_target_properties(clang PROPERTIES VERSION ${CLANG_EXECUTABLE_VERSION})
|
|
|
|
|
2009-11-20 00:42:34 +08:00
|
|
|
if(UNIX)
|
|
|
|
set(CLANGXX_LINK_OR_COPY create_symlink)
|
|
|
|
else()
|
|
|
|
set(CLANGXX_LINK_OR_COPY copy)
|
|
|
|
endif()
|
|
|
|
|
2009-11-19 13:46:45 +08:00
|
|
|
# Create the clang++ symlink in the build directory.
|
2011-02-06 23:33:08 +08:00
|
|
|
set(clang_pp "${LLVM_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/clang++${CMAKE_EXECUTABLE_SUFFIX}")
|
2009-11-19 13:46:45 +08:00
|
|
|
add_custom_target(clang++ ALL
|
2009-11-20 00:42:34 +08:00
|
|
|
${CMAKE_COMMAND} -E ${CLANGXX_LINK_OR_COPY}
|
2011-02-06 23:33:08 +08:00
|
|
|
"${LLVM_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/clang${CMAKE_EXECUTABLE_SUFFIX}"
|
2011-02-06 05:37:37 +08:00
|
|
|
"${clang_pp}"
|
2009-11-19 13:46:45 +08:00
|
|
|
DEPENDS clang)
|
2011-02-21 06:06:44 +08:00
|
|
|
set_target_properties(clang++ PROPERTIES FOLDER "Clang executables")
|
2011-02-26 03:24:02 +08:00
|
|
|
|
2011-02-06 05:37:37 +08:00
|
|
|
set_property(DIRECTORY APPEND
|
|
|
|
PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${clang_pp})
|
2009-11-19 13:46:45 +08:00
|
|
|
|
2009-08-23 13:28:29 +08:00
|
|
|
install(TARGETS clang
|
|
|
|
RUNTIME DESTINATION bin)
|
2009-11-19 13:46:45 +08:00
|
|
|
|
|
|
|
# Create the clang++ symlink at installation time.
|
2010-10-18 00:10:32 +08:00
|
|
|
install(SCRIPT clang_symlink.cmake -DCMAKE_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\")
|