diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/CMakeLists.txt | 13 | ||||
-rw-r--r-- | tools/bugpoint/CMakeLists.txt | 13 | ||||
-rw-r--r-- | tools/llc/CMakeLists.txt | 5 | ||||
-rw-r--r-- | tools/lli/CMakeLists.txt | 5 | ||||
-rw-r--r-- | tools/llvm-ar/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tools/llvm-as/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tools/llvm-bcanalyzer/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tools/llvm-config/CMakeLists.txt | 25 | ||||
-rw-r--r-- | tools/llvm-diff/CMakeLists.txt | 4 | ||||
-rw-r--r-- | tools/llvm-dis/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tools/llvm-extract/CMakeLists.txt | 9 | ||||
-rw-r--r-- | tools/llvm-ld/CMakeLists.txt | 10 | ||||
-rw-r--r-- | tools/llvm-link/CMakeLists.txt | 9 | ||||
-rw-r--r-- | tools/llvm-mc/CMakeLists.txt | 5 | ||||
-rw-r--r-- | tools/llvm-nm/CMakeLists.txt | 4 | ||||
-rw-r--r-- | tools/llvm-prof/CMakeLists.txt | 4 | ||||
-rw-r--r-- | tools/llvm-ranlib/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tools/opt/CMakeLists.txt | 11 |
18 files changed, 65 insertions, 67 deletions
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index c4274dd..7ed10e9 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -2,6 +2,15 @@ # large and three small executables. This is done to minimize memory load # in parallel builds. Please retain this ordering. +if( NOT WIN32 OR MSYS OR CYGWIN ) + # It is useful to build llvm-config before the other tools, so we + # have a fresh LibDeps.txt for regenerating the hard-coded library + # dependencies. llvm-config/CMakeLists.txt takes care of this but we + # must keep llvm-config as the first entry on the list of tools to + # be built. + add_subdirectory(llvm-config) +endif() + add_subdirectory(opt) add_subdirectory(llvm-as) add_subdirectory(llvm-dis) @@ -29,4 +38,6 @@ add_subdirectory(llvmc) if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/clang/CMakeLists.txt ) add_subdirectory( ${CMAKE_CURRENT_SOURCE_DIR}/clang ) -endif() +endif( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/clang/CMakeLists.txt ) + +set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} PARENT_SCOPE) diff --git a/tools/bugpoint/CMakeLists.txt b/tools/bugpoint/CMakeLists.txt index 731c7bf..e06feb1 100644 --- a/tools/bugpoint/CMakeLists.txt +++ b/tools/bugpoint/CMakeLists.txt @@ -1,3 +1,6 @@ +set(LLVM_LINK_COMPONENTS asmparser instrumentation scalaropts ipo + linker bitreader bitwriter) + add_llvm_tool(bugpoint BugDriver.cpp CrashDebugger.cpp @@ -9,13 +12,3 @@ add_llvm_tool(bugpoint ToolRunner.cpp bugpoint.cpp ) - -target_link_libraries(bugpoint - LLVMAsmParser - LLVMInstrumentation - LLVMScalarOpts - LLVMipo - LLVMLinker - LLVMBitReader - LLVMBitWriter - ) diff --git a/tools/llc/CMakeLists.txt b/tools/llc/CMakeLists.txt index 798578e..683f298 100644 --- a/tools/llc/CMakeLists.txt +++ b/tools/llc/CMakeLists.txt @@ -1,6 +1,5 @@ +set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} bitreader asmparser) + add_llvm_tool(llc llc.cpp ) - -add_llvm_link_components(llc all) -target_link_libraries(llc LLVMBitReader LLVMAsmParser) diff --git a/tools/lli/CMakeLists.txt b/tools/lli/CMakeLists.txt index 8fd34ac..ce70d46 100644 --- a/tools/lli/CMakeLists.txt +++ b/tools/lli/CMakeLists.txt @@ -1,6 +1,5 @@ +set(LLVM_LINK_COMPONENTS jit interpreter nativecodegen bitreader selectiondag) + add_llvm_tool(lli lli.cpp ) - -add_llvm_link_components(lli jit interpreter nativecodegen) -target_link_libraries(lli LLVMBitReader LLVMSelectionDAG) diff --git a/tools/llvm-ar/CMakeLists.txt b/tools/llvm-ar/CMakeLists.txt index 65ad36a..c8b0b72 100644 --- a/tools/llvm-ar/CMakeLists.txt +++ b/tools/llvm-ar/CMakeLists.txt @@ -1,9 +1,8 @@ +set(LLVM_LINK_COMPONENTS archive) set(LLVM_REQUIRES_EH 1) add_llvm_tool(llvm-ar llvm-ar.cpp ) -target_link_libraries(llvm-ar LLVMArchive) - # TODO: Support check-local. diff --git a/tools/llvm-as/CMakeLists.txt b/tools/llvm-as/CMakeLists.txt index 05f5fd7..eef4a13 100644 --- a/tools/llvm-as/CMakeLists.txt +++ b/tools/llvm-as/CMakeLists.txt @@ -1,7 +1,6 @@ +set(LLVM_LINK_COMPONENTS asmparser bitwriter) set(LLVM_REQUIRES_EH 1) add_llvm_tool(llvm-as llvm-as.cpp ) - -target_link_libraries(llvm-as LLVMAsmParser LLVMBitWriter) diff --git a/tools/llvm-bcanalyzer/CMakeLists.txt b/tools/llvm-bcanalyzer/CMakeLists.txt index 2be4243..732bc32 100644 --- a/tools/llvm-bcanalyzer/CMakeLists.txt +++ b/tools/llvm-bcanalyzer/CMakeLists.txt @@ -1,7 +1,6 @@ +set(LLVM_LINK_COMPONENTS bitreader) set(LLVM_REQUIRES_EH 1) add_llvm_tool(llvm-bcanalyzer llvm-bcanalyzer.cpp ) - -target_link_libraries(llvm-bcanalyzer LLVMBitReader) diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt index 8887a64..663cae5 100644 --- a/tools/llvm-config/CMakeLists.txt +++ b/tools/llvm-config/CMakeLists.txt @@ -110,6 +110,10 @@ add_custom_target(llvm-config.target ALL add_dependencies(llvm-config.target ${llvm_lib_targets}) +# Make sure that llvm-config builds before the llvm tools, so we have +# LibDeps.txt and can use it for updating the hard-coded library +# dependencies on cmake/modules/LLVMLibDeps.cmake when the tools' +# build fail due to outdated dependencies: set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} llvm-config.target) install(FILES ${LLVM_CONFIG} @@ -118,4 +122,25 @@ install(FILES ${LLVM_CONFIG} DESTINATION bin) +# Regeneration of library dependencies. + +# See the comments at the end of cmake/modules/LLVMConfig.cmake for +# notes and guidelines. + +set(LLVMLibDeps ${LLVM_MAIN_SRC_DIR}/cmake/modules/LLVMLibDeps.cmake) +set(LLVMLibDeps_TMP ${CMAKE_CURRENT_BINARY_DIR}/LLVMLibDeps.cmake.tmp) + +add_custom_command(OUTPUT ${LLVMLibDeps_TMP} + COMMAND sed -e s'@\\.a@@g' -e s'@\\.so@@g' -e 's@libLLVM@LLVM@g' -e 's@: @ @' -e 's@\\\(.*\\\)@set\(MSVC_LIB_DEPS_\\1\)@' ${FINAL_LIBDEPS} > ${LLVMLibDeps_TMP} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LLVMLibDeps_TMP} ${LLVMLibDeps} + DEPENDS ${FINAL_LIBDEPS} + COMMENT "Updating cmake library dependencies file ${LLVMLibDeps}" + ) + +if( LLVM_TARGETS_TO_BUILD STREQUAL LLVM_ALL_TARGETS ) + add_custom_target(llvmlibdeps.target ALL DEPENDS ${LLVMLibDeps_TMP}) + add_dependencies(llvmlibdeps.target llvm-config.target) + set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} llvmlibdeps.target) +endif() + set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} PARENT_SCOPE) diff --git a/tools/llvm-diff/CMakeLists.txt b/tools/llvm-diff/CMakeLists.txt index 42e2ba8..f6d65c9 100644 --- a/tools/llvm-diff/CMakeLists.txt +++ b/tools/llvm-diff/CMakeLists.txt @@ -1,6 +1,6 @@ +set(LLVM_LINK_COMPONENTS support asmparser bitreader) + add_llvm_tool(llvm-diff llvm-diff.cpp DifferenceEngine.cpp ) - -target_link_libraries(llvm-diff LLVMAsmParser LLVMBitReader) diff --git a/tools/llvm-dis/CMakeLists.txt b/tools/llvm-dis/CMakeLists.txt index fb76772..d62a6b5 100644 --- a/tools/llvm-dis/CMakeLists.txt +++ b/tools/llvm-dis/CMakeLists.txt @@ -1,7 +1,6 @@ +set(LLVM_LINK_COMPONENTS bitreader) set(LLVM_REQUIRES_EH 1) add_llvm_tool(llvm-dis llvm-dis.cpp ) - -target_link_libraries(llvm-dis LLVMCore LLVMBitReader) diff --git a/tools/llvm-extract/CMakeLists.txt b/tools/llvm-extract/CMakeLists.txt index e3b728c..a4e3266 100644 --- a/tools/llvm-extract/CMakeLists.txt +++ b/tools/llvm-extract/CMakeLists.txt @@ -1,10 +1,5 @@ +set(LLVM_LINK_COMPONENTS asmparser ipo bitreader bitwriter) + add_llvm_tool(llvm-extract llvm-extract.cpp ) - -target_link_libraries(llvm-extract - LLVMAsmParser - LLVMipo - LLVMBitReader - LLVMBitWriter - ) diff --git a/tools/llvm-ld/CMakeLists.txt b/tools/llvm-ld/CMakeLists.txt index 8fba66b..2ae4a1d 100644 --- a/tools/llvm-ld/CMakeLists.txt +++ b/tools/llvm-ld/CMakeLists.txt @@ -1,12 +1,6 @@ +set(LLVM_LINK_COMPONENTS ipo scalaropts linker archive bitwriter) + add_llvm_tool(llvm-ld Optimize.cpp llvm-ld.cpp ) - -target_link_libraries(llvm-ld - LLVMipo - LLVMScalarOpts - LLVMLinker - LLVMArchive - LLVMBitWriter - ) diff --git a/tools/llvm-link/CMakeLists.txt b/tools/llvm-link/CMakeLists.txt index e837a48..11933f7 100644 --- a/tools/llvm-link/CMakeLists.txt +++ b/tools/llvm-link/CMakeLists.txt @@ -1,10 +1,5 @@ +set(LLVM_LINK_COMPONENTS linker bitreader bitwriter asmparser) + add_llvm_tool(llvm-link llvm-link.cpp ) - -target_link_libraries(llvm-link - LLVMLinker - LLVMBitReader - LLVMBitWriter - LLVMAsmParser - ) diff --git a/tools/llvm-mc/CMakeLists.txt b/tools/llvm-mc/CMakeLists.txt index ea987db..805caf4 100644 --- a/tools/llvm-mc/CMakeLists.txt +++ b/tools/llvm-mc/CMakeLists.txt @@ -1,7 +1,6 @@ +set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} support MC MCParser MCDisassembler) + add_llvm_tool(llvm-mc llvm-mc.cpp Disassembler.cpp ) - -add_llvm_link_components(llvm-mc all) -target_link_libraries(llvm-mc LLVMMC LLVMMCParser LLVMMCDisassembler) diff --git a/tools/llvm-nm/CMakeLists.txt b/tools/llvm-nm/CMakeLists.txt index c771155..45cf1b6 100644 --- a/tools/llvm-nm/CMakeLists.txt +++ b/tools/llvm-nm/CMakeLists.txt @@ -1,5 +1,5 @@ +set(LLVM_LINK_COMPONENTS archive bitreader) + add_llvm_tool(llvm-nm llvm-nm.cpp ) - -target_link_libraries(llvm-nm LLVMArchive LLVMBitReader) diff --git a/tools/llvm-prof/CMakeLists.txt b/tools/llvm-prof/CMakeLists.txt index e1d95dd..442112b 100644 --- a/tools/llvm-prof/CMakeLists.txt +++ b/tools/llvm-prof/CMakeLists.txt @@ -1,5 +1,5 @@ +set(LLVM_LINK_COMPONENTS bitreader analysis) + add_llvm_tool(llvm-prof llvm-prof.cpp ) - -target_link_libraries(llvm-prof LLVMBitReader LLVMAnalysis) diff --git a/tools/llvm-ranlib/CMakeLists.txt b/tools/llvm-ranlib/CMakeLists.txt index ab3fa37..3116d2e 100644 --- a/tools/llvm-ranlib/CMakeLists.txt +++ b/tools/llvm-ranlib/CMakeLists.txt @@ -1,7 +1,6 @@ +set(LLVM_LINK_COMPONENTS archive) set(LLVM_REQUIRES_EH 1) add_llvm_tool(llvm-ranlib llvm-ranlib.cpp ) - -target_link_libraries(llvm-ranlib LLVMArchive) diff --git a/tools/opt/CMakeLists.txt b/tools/opt/CMakeLists.txt index 5eff9d8..0570d0e 100644 --- a/tools/opt/CMakeLists.txt +++ b/tools/opt/CMakeLists.txt @@ -1,15 +1,8 @@ +set(LLVM_LINK_COMPONENTS bitreader asmparser bitwriter instrumentation scalaropts ipo) + add_llvm_tool(opt AnalysisWrappers.cpp GraphPrinters.cpp PrintSCC.cpp opt.cpp ) - -target_link_libraries(opt - LLVMBitReader - LLVMAsmParser - LLVMBitWriter - LLVMInstrumentation - LLVMScalarOpts - LLVMipo - ) |