diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-09-10 21:14:25 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-09-10 21:14:25 +0000 |
commit | 4e9c939312ff73bd0c6a6485fd5f97012f5910fa (patch) | |
tree | 5ac7e42fde2303030a9af1183b7842986459bc45 /tools | |
parent | bb811a244567aa8a1522203f15588f4d001b7353 (diff) | |
download | external_llvm-4e9c939312ff73bd0c6a6485fd5f97012f5910fa.zip external_llvm-4e9c939312ff73bd0c6a6485fd5f97012f5910fa.tar.gz external_llvm-4e9c939312ff73bd0c6a6485fd5f97012f5910fa.tar.bz2 |
CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113632 91177308-0d34-0410-b5e6-96231b3b80d8
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, 67 insertions, 65 deletions
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 7ed10e9..c4274dd 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -2,15 +2,6 @@ # 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) @@ -38,6 +29,4 @@ add_subdirectory(llvmc) if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/clang/CMakeLists.txt ) add_subdirectory( ${CMAKE_CURRENT_SOURCE_DIR}/clang ) -endif( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/clang/CMakeLists.txt ) - -set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} PARENT_SCOPE) +endif() diff --git a/tools/bugpoint/CMakeLists.txt b/tools/bugpoint/CMakeLists.txt index e06feb1..731c7bf 100644 --- a/tools/bugpoint/CMakeLists.txt +++ b/tools/bugpoint/CMakeLists.txt @@ -1,6 +1,3 @@ -set(LLVM_LINK_COMPONENTS asmparser instrumentation scalaropts ipo - linker bitreader bitwriter) - add_llvm_tool(bugpoint BugDriver.cpp CrashDebugger.cpp @@ -12,3 +9,13 @@ 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 683f298..798578e 100644 --- a/tools/llc/CMakeLists.txt +++ b/tools/llc/CMakeLists.txt @@ -1,5 +1,6 @@ -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 ce70d46..8fd34ac 100644 --- a/tools/lli/CMakeLists.txt +++ b/tools/lli/CMakeLists.txt @@ -1,5 +1,6 @@ -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 c8b0b72..65ad36a 100644 --- a/tools/llvm-ar/CMakeLists.txt +++ b/tools/llvm-ar/CMakeLists.txt @@ -1,8 +1,9 @@ -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 eef4a13..05f5fd7 100644 --- a/tools/llvm-as/CMakeLists.txt +++ b/tools/llvm-as/CMakeLists.txt @@ -1,6 +1,7 @@ -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 732bc32..2be4243 100644 --- a/tools/llvm-bcanalyzer/CMakeLists.txt +++ b/tools/llvm-bcanalyzer/CMakeLists.txt @@ -1,6 +1,7 @@ -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 663cae5..8887a64 100644 --- a/tools/llvm-config/CMakeLists.txt +++ b/tools/llvm-config/CMakeLists.txt @@ -110,10 +110,6 @@ 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} @@ -122,25 +118,4 @@ 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 f6d65c9..42e2ba8 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 d62a6b5..fb76772 100644 --- a/tools/llvm-dis/CMakeLists.txt +++ b/tools/llvm-dis/CMakeLists.txt @@ -1,6 +1,7 @@ -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 a4e3266..e3b728c 100644 --- a/tools/llvm-extract/CMakeLists.txt +++ b/tools/llvm-extract/CMakeLists.txt @@ -1,5 +1,10 @@ -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 2ae4a1d..8fba66b 100644 --- a/tools/llvm-ld/CMakeLists.txt +++ b/tools/llvm-ld/CMakeLists.txt @@ -1,6 +1,12 @@ -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 11933f7..e837a48 100644 --- a/tools/llvm-link/CMakeLists.txt +++ b/tools/llvm-link/CMakeLists.txt @@ -1,5 +1,10 @@ -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 805caf4..ea987db 100644 --- a/tools/llvm-mc/CMakeLists.txt +++ b/tools/llvm-mc/CMakeLists.txt @@ -1,6 +1,7 @@ -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 45cf1b6..c771155 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 442112b..e1d95dd 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 3116d2e..ab3fa37 100644 --- a/tools/llvm-ranlib/CMakeLists.txt +++ b/tools/llvm-ranlib/CMakeLists.txt @@ -1,6 +1,7 @@ -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 0570d0e..5eff9d8 100644 --- a/tools/opt/CMakeLists.txt +++ b/tools/opt/CMakeLists.txt @@ -1,8 +1,15 @@ -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 + ) |