2009-03-25 01:52:34 +08:00
|
|
|
set(LLVM_NO_RTTI 1)
|
|
|
|
|
2009-03-24 10:52:57 +08:00
|
|
|
set( LLVM_USED_LIBS
|
2009-12-12 06:20:12 +08:00
|
|
|
clangFrontend
|
2010-01-29 18:03:42 +08:00
|
|
|
clangDriver
|
2009-12-12 06:20:12 +08:00
|
|
|
clangCodeGen
|
2010-01-29 18:03:42 +08:00
|
|
|
clangSema
|
2010-01-25 12:41:41 +08:00
|
|
|
clangChecker
|
2009-12-12 06:20:12 +08:00
|
|
|
clangAnalysis
|
2010-07-17 19:59:16 +08:00
|
|
|
clangIndex
|
2009-12-12 06:20:12 +08:00
|
|
|
clangRewrite
|
|
|
|
clangAST
|
|
|
|
clangParse
|
|
|
|
clangLex
|
2009-03-24 10:52:57 +08:00
|
|
|
clangBasic
|
|
|
|
)
|
|
|
|
|
2009-12-12 06:20:12 +08:00
|
|
|
set( LLVM_LINK_COMPONENTS
|
|
|
|
${LLVM_TARGETS_TO_BUILD}
|
2010-06-08 07:27:59 +08:00
|
|
|
asmparser
|
2009-12-12 06:20:12 +08:00
|
|
|
bitreader
|
|
|
|
bitwriter
|
|
|
|
codegen
|
|
|
|
ipo
|
|
|
|
selectiondag
|
|
|
|
)
|
2009-03-24 10:52:57 +08:00
|
|
|
|
2009-03-25 01:52:34 +08:00
|
|
|
add_clang_executable(clang
|
2009-03-24 10:52:57 +08:00
|
|
|
driver.cpp
|
2009-11-19 15:37:51 +08:00
|
|
|
cc1_main.cpp
|
2010-05-21 01:49:16 +08:00
|
|
|
cc1as_main.cpp
|
2009-03-24 10:52:57 +08:00
|
|
|
)
|
2009-06-17 06:26:26 +08:00
|
|
|
|
2009-11-20 00:42:34 +08:00
|
|
|
if(UNIX)
|
|
|
|
set(CLANGXX_LINK_OR_COPY create_symlink)
|
2010-04-28 00:14:06 +08:00
|
|
|
set(CLANGXX_DESTDIR $ENV{DESTDIR}/)
|
2009-11-20 00:42:34 +08:00
|
|
|
else()
|
|
|
|
set(CLANGXX_LINK_OR_COPY copy)
|
|
|
|
endif()
|
|
|
|
|
2009-11-19 13:46:45 +08:00
|
|
|
# Create the clang++ symlink in the build directory.
|
|
|
|
add_custom_target(clang++ ALL
|
2009-11-20 00:42:34 +08:00
|
|
|
${CMAKE_COMMAND} -E ${CLANGXX_LINK_OR_COPY}
|
2009-11-19 15:59:29 +08:00
|
|
|
"${LLVM_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/clang${CMAKE_EXECUTABLE_SUFFIX}"
|
|
|
|
"${LLVM_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/clang++${CMAKE_EXECUTABLE_SUFFIX}"
|
2009-11-19 13:46:45 +08:00
|
|
|
DEPENDS clang)
|
|
|
|
|
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-04-28 00:14:06 +08:00
|
|
|
install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E ${CLANGXX_LINK_OR_COPY} \"${CMAKE_INSTALL_PREFIX}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}\" \"${CLANGXX_DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/clang++${CMAKE_EXECUTABLE_SUFFIX}\")")
|