llvm-project/clang/tools/driver/CMakeLists.txt

53 lines
1.2 KiB
CMake
Raw Normal View History

set(LLVM_NO_RTTI 1)
add_clang_executable(clang
driver.cpp
cc1_main.cpp
cc1as_main.cpp
)
add_llvm_link_components(clang all)
target_link_libraries(clang
LLVMAsmParser
LLVMBitReader
LLVMBitWriter
LLVMCodeGen
LLVMipo
LLVMSelectionDAG
clangFrontendTool
clangFrontend
clangDriver
clangSerialization
clangCodeGen
clangParse
clangSema
clangChecker
clangAnalysis
2010-07-17 19:59:16 +08:00
clangIndex
clangRewrite
clangAST
clangLex
clangBasic
)
if(UNIX)
set(CLANGXX_LINK_OR_COPY create_symlink)
set(CLANGXX_DESTDIR $ENV{DESTDIR}/)
else()
set(CLANGXX_LINK_OR_COPY copy)
endif()
# Create the clang++ symlink in the build directory.
add_custom_target(clang++ ALL
${CMAKE_COMMAND} -E ${CLANGXX_LINK_OR_COPY}
"${LLVM_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/clang${CMAKE_EXECUTABLE_SUFFIX}"
"${LLVM_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/clang++${CMAKE_EXECUTABLE_SUFFIX}"
DEPENDS clang)
install(TARGETS clang
RUNTIME DESTINATION bin)
# Create the clang++ symlink at installation time.
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}\")")