diff options
author | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-10-15 17:10:06 +1100 |
---|---|---|
committer | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-10-15 17:10:06 +1100 |
commit | be1de4be954c80875ad4108e0a33e8e131b2f2c0 (patch) | |
tree | 1fbbecf276bf7c7bdcbb4dd446099d6d90eaa516 /clang/tools/driver/CMakeLists.txt | |
parent | c4626a62754862d20b41e8a46a3574264ea80e6d (diff) | |
parent | f1bd2e48c5324d3f7cda4090c87f8a5b6f463ce2 (diff) |
Merge branch 'master' of ssh://bitbucket.org/czan/honours
Diffstat (limited to 'clang/tools/driver/CMakeLists.txt')
-rw-r--r-- | clang/tools/driver/CMakeLists.txt | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/clang/tools/driver/CMakeLists.txt b/clang/tools/driver/CMakeLists.txt new file mode 100644 index 0000000..ae49ac1 --- /dev/null +++ b/clang/tools/driver/CMakeLists.txt @@ -0,0 +1,63 @@ +set( LLVM_USED_LIBS + clangFrontendTool + clangAST + clangAnalysis + clangBasic + clangCodeGen + clangDriver + clangEdit + clangFrontend + clangLex + clangParse + clangEdit + clangARCMigrate + clangRewrite + clangSema + clangSerialization + clangStaticAnalyzerFrontend + clangStaticAnalyzerCheckers + clangStaticAnalyzerCore + ) + +set( LLVM_LINK_COMPONENTS + ${LLVM_TARGETS_TO_BUILD} + asmparser + bitreader + bitwriter + codegen + instrumentation + ipo + linker + selectiondag + ) + +add_clang_executable(clang + driver.cpp + cc1_main.cpp + cc1as_main.cpp + ) + +set_target_properties(clang PROPERTIES VERSION ${CLANG_EXECUTABLE_VERSION}) + +if(UNIX) + set(CLANGXX_LINK_OR_COPY create_symlink) +# Create a relative symlink + set(clang_binary "clang${CMAKE_EXECUTABLE_SUFFIX}") +else() + set(CLANGXX_LINK_OR_COPY copy) + set(clang_binary "${LLVM_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/clang${CMAKE_EXECUTABLE_SUFFIX}") +endif() + +# Create the clang++ symlink in the build directory. +set(clang_pp "${LLVM_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/clang++${CMAKE_EXECUTABLE_SUFFIX}") +add_custom_command(TARGET clang POST_BUILD + COMMAND ${CMAKE_COMMAND} -E ${CLANGXX_LINK_OR_COPY} "${clang_binary}" "${clang_pp}") + +set_property(DIRECTORY APPEND + PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${clang_pp}) + +install(TARGETS clang + RUNTIME DESTINATION bin) + +# Create the clang++ symlink at installation time. +install(SCRIPT clang_symlink.cmake -DCMAKE_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\") |