Home | History | Annotate | Download | only in driver
      1 set( LLVM_USED_LIBS
      2   clangAST
      3   clangAnalysis
      4   clangBasic
      5   clangCodeGen
      6   clangDriver
      7   clangFrontend
      8   clangFrontendTool
      9   clangIndex
     10   clangLex
     11   clangParse
     12   clangARCMigrate
     13   clangRewrite
     14   clangSema
     15   clangSerialization
     16   clangStaticAnalyzerFrontend
     17   clangStaticAnalyzerCheckers
     18   clangStaticAnalyzerCore
     19   )
     20 
     21 set( LLVM_LINK_COMPONENTS
     22   ${LLVM_TARGETS_TO_BUILD}
     23   asmparser
     24   bitreader
     25   bitwriter
     26   codegen
     27   instrumentation
     28   ipo
     29   selectiondag
     30   )
     31 
     32 add_clang_executable(clang
     33   driver.cpp
     34   cc1_main.cpp
     35   cc1as_main.cpp
     36   )
     37 
     38 set_target_properties(clang PROPERTIES VERSION ${CLANG_EXECUTABLE_VERSION})
     39 
     40 if(UNIX)
     41   set(CLANGXX_LINK_OR_COPY create_symlink)
     42 else()
     43   set(CLANGXX_LINK_OR_COPY copy)
     44 endif()
     45 
     46 # Create the clang++ symlink in the build directory.
     47 set(clang_pp "${LLVM_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/clang++${CMAKE_EXECUTABLE_SUFFIX}")
     48 add_custom_target(clang++ ALL
     49   ${CMAKE_COMMAND} -E ${CLANGXX_LINK_OR_COPY}
     50     "${LLVM_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/clang${CMAKE_EXECUTABLE_SUFFIX}"
     51     "${clang_pp}"
     52   DEPENDS clang)
     53 set_target_properties(clang++ PROPERTIES FOLDER "Clang executables")
     54 
     55 set_property(DIRECTORY APPEND
     56   PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${clang_pp})
     57 
     58 install(TARGETS clang
     59   RUNTIME DESTINATION bin)
     60 
     61 # Create the clang++ symlink at installation time.
     62 install(SCRIPT clang_symlink.cmake -DCMAKE_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\")
     63