diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-07-29 00:14:25 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-07-29 00:14:25 +0000 |
commit | ac03e736c77bcf7e8deb515fc16a7e55d343dc8d (patch) | |
tree | a44bdf6027c817797e42b65459d3a8ab9d66ad20 /lib | |
parent | 00eab6c716e206491de195ae4dd85ea493c98582 (diff) |
Rewrite the CMake build to use explicit dependencies between libraries,
specified in the same file that the library itself is created. This is
more idiomatic for CMake builds, and also allows us to correctly specify
dependencies that are missed due to bugs in the GenLibDeps perl script,
or change from compiler to compiler. On Linux, this returns CMake to
a place where it can relably rebuild several targets of LLVM.
I have tried not to change the dependencies from the ones in the current
auto-generated file. The only places I've really diverged are in places
where I was seeing link failures, and added a dependency. The goal of
this patch is not to start changing the dependencies, merely to move
them into the correct location, and an explicit form that we can control
and change when necessary.
This also removes a serialization point in the build because we don't
have to scan all the libraries before we begin building various tools.
We no longer have a step of the build that regenerates a file inside the
source tree. A few other associated cleanups fall out of this.
This isn't really finished yet though. After talking to dgregor he urged
switching to a single CMake macro to construct libraries with both
sources and dependencies in the arguments. Migrating from the two macros
to that style will be a follow-up patch.
Also, llvm-config is still generated with GenLibDeps.pl, which means it
still has slightly buggy dependencies. The internal CMake
'llvm-config-like' macro uses the correct explicitly specified
dependencies however. A future patch will switch llvm-config generation
(when using CMake) to be based on these deps as well.
This may well break Windows. I'm getting a machine set up now to dig
into any failures there. If anyone can chime in with problems they see
or ideas of how to solve them for Windows, much appreciated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136433 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
82 files changed, 666 insertions, 14 deletions
diff --git a/lib/Analysis/CMakeLists.txt b/lib/Analysis/CMakeLists.txt index cb1e1ebbd1..e79459d7a4 100644 --- a/lib/Analysis/CMakeLists.txt +++ b/lib/Analysis/CMakeLists.txt @@ -58,4 +58,10 @@ add_llvm_library(LLVMAnalysis ValueTracking.cpp ) +add_llvm_library_dependencies(LLVMAnalysis + LLVMCore + LLVMSupport + LLVMTarget + ) + add_subdirectory(IPA) diff --git a/lib/Analysis/IPA/CMakeLists.txt b/lib/Analysis/IPA/CMakeLists.txt index 8ffef29870..eae83fdc36 100644 --- a/lib/Analysis/IPA/CMakeLists.txt +++ b/lib/Analysis/IPA/CMakeLists.txt @@ -5,3 +5,9 @@ add_llvm_library(LLVMipa GlobalsModRef.cpp IPA.cpp ) + +add_llvm_library_dependencies(LLVMipa + LLVMAnalysis + LLVMCore + LLVMSupport + ) diff --git a/lib/Archive/CMakeLists.txt b/lib/Archive/CMakeLists.txt index 7ff478a41a..b52974e075 100644 --- a/lib/Archive/CMakeLists.txt +++ b/lib/Archive/CMakeLists.txt @@ -3,3 +3,9 @@ add_llvm_library(LLVMArchive ArchiveReader.cpp ArchiveWriter.cpp ) + +add_llvm_library_dependencies(LLVMArchive + LLVMBitReader + LLVMCore + LLVMSupport + ) diff --git a/lib/AsmParser/CMakeLists.txt b/lib/AsmParser/CMakeLists.txt index 985ebe2009..749601510b 100644 --- a/lib/AsmParser/CMakeLists.txt +++ b/lib/AsmParser/CMakeLists.txt @@ -4,3 +4,8 @@ add_llvm_library(LLVMAsmParser LLParser.cpp Parser.cpp ) + +add_llvm_library_dependencies(LLVMAsmParser + LLVMCore + LLVMSupport + ) diff --git a/lib/Bitcode/Reader/CMakeLists.txt b/lib/Bitcode/Reader/CMakeLists.txt index 693d4310b8..37bebc4496 100644 --- a/lib/Bitcode/Reader/CMakeLists.txt +++ b/lib/Bitcode/Reader/CMakeLists.txt @@ -2,3 +2,8 @@ add_llvm_library(LLVMBitReader BitReader.cpp BitcodeReader.cpp ) + +add_llvm_library_dependencies(LLVMBitReader + LLVMCore + LLVMSupport + ) diff --git a/lib/Bitcode/Writer/CMakeLists.txt b/lib/Bitcode/Writer/CMakeLists.txt index f097b097c3..3cf905697a 100644 --- a/lib/Bitcode/Writer/CMakeLists.txt +++ b/lib/Bitcode/Writer/CMakeLists.txt @@ -4,3 +4,8 @@ add_llvm_library(LLVMBitWriter BitcodeWriterPass.cpp ValueEnumerator.cpp ) + +add_llvm_library_dependencies(LLVMBitWriter + LLVMCore + LLVMSupport + ) diff --git a/lib/CodeGen/AsmPrinter/CMakeLists.txt b/lib/CodeGen/AsmPrinter/CMakeLists.txt index 4da7876ea4..67d927348b 100644 --- a/lib/CodeGen/AsmPrinter/CMakeLists.txt +++ b/lib/CodeGen/AsmPrinter/CMakeLists.txt @@ -12,3 +12,12 @@ add_llvm_library(LLVMAsmPrinter Win64Exception.cpp ) +add_llvm_library_dependencies(LLVMAsmPrinter + LLVMAnalysis + LLVMCodeGen + LLVMCore + LLVMMC + LLVMMCParser + LLVMSupport + LLVMTarget + ) diff --git a/lib/CodeGen/CMakeLists.txt b/lib/CodeGen/CMakeLists.txt index 5e4fb44219..9cbb25cebe 100644 --- a/lib/CodeGen/CMakeLists.txt +++ b/lib/CodeGen/CMakeLists.txt @@ -97,5 +97,15 @@ add_llvm_library(LLVMCodeGen VirtRegRewriter.cpp ) +add_llvm_library_dependencies(LLVMCodeGen + LLVMAnalysis + LLVMCore + LLVMMC + LLVMScalarOpts + LLVMSupport + LLVMTarget + LLVMTransformUtils + ) + add_subdirectory(SelectionDAG) add_subdirectory(AsmPrinter) diff --git a/lib/CodeGen/SelectionDAG/CMakeLists.txt b/lib/CodeGen/SelectionDAG/CMakeLists.txt index 15932c03a1..2282f0e6eb 100644 --- a/lib/CodeGen/SelectionDAG/CMakeLists.txt +++ b/lib/CodeGen/SelectionDAG/CMakeLists.txt @@ -21,3 +21,13 @@ add_llvm_library(LLVMSelectionDAG TargetLowering.cpp TargetSelectionDAGInfo.cpp ) + +add_llvm_library_dependencies(LLVMSelectionDAG + LLVMAnalysis + LLVMCodeGen + LLVMCore + LLVMMC + LLVMSupport + LLVMTarget + LLVMTransformUtils + ) diff --git a/lib/ExecutionEngine/CMakeLists.txt b/lib/ExecutionEngine/CMakeLists.txt index 58caae830f..fb14d41e91 100644 --- a/lib/ExecutionEngine/CMakeLists.txt +++ b/lib/ExecutionEngine/CMakeLists.txt @@ -4,6 +4,13 @@ add_llvm_library(LLVMExecutionEngine TargetSelect.cpp ) +add_llvm_library_dependencies(LLVMExecutionEngine + LLVMCore + LLVMMC + LLVMSupport + LLVMTarget + ) + add_subdirectory(Interpreter) add_subdirectory(JIT) add_subdirectory(MCJIT) diff --git a/lib/ExecutionEngine/Interpreter/CMakeLists.txt b/lib/ExecutionEngine/Interpreter/CMakeLists.txt index d331f830b6..4fb58c2e37 100644 --- a/lib/ExecutionEngine/Interpreter/CMakeLists.txt +++ b/lib/ExecutionEngine/Interpreter/CMakeLists.txt @@ -12,6 +12,14 @@ add_llvm_library(LLVMInterpreter Interpreter.cpp ) +add_llvm_library_dependencies(LLVMInterpreter + LLVMCodeGen + LLVMCore + LLVMExecutionEngine + LLVMSupport + LLVMTarget + ) + if( LLVM_ENABLE_FFI ) target_link_libraries( LLVMInterpreter ${FFI_LIBRARY_PATH} ) endif() diff --git a/lib/ExecutionEngine/JIT/CMakeLists.txt b/lib/ExecutionEngine/JIT/CMakeLists.txt index cefb0aedde..598e50e794 100644 --- a/lib/ExecutionEngine/JIT/CMakeLists.txt +++ b/lib/ExecutionEngine/JIT/CMakeLists.txt @@ -10,3 +10,11 @@ add_llvm_library(LLVMJIT JITMemoryManager.cpp OProfileJITEventListener.cpp ) + +add_llvm_library_dependencies(LLVMJIT + LLVMCore + LLVMExecutionEngine + LLVMRuntimeDyld + LLVMSupport + LLVMTarget + ) diff --git a/lib/ExecutionEngine/MCJIT/CMakeLists.txt b/lib/ExecutionEngine/MCJIT/CMakeLists.txt index 38fdffa0e9..aae8a1b2c5 100644 --- a/lib/ExecutionEngine/MCJIT/CMakeLists.txt +++ b/lib/ExecutionEngine/MCJIT/CMakeLists.txt @@ -2,3 +2,11 @@ add_llvm_library(LLVMMCJIT MCJIT.cpp Intercept.cpp ) + +add_llvm_library_dependencies(LLVMMCJIT + LLVMCore + LLVMExecutionEngine + LLVMRuntimeDyld + LLVMSupport + LLVMTarget + ) diff --git a/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt b/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt index 59bdfee3db..c236d1d9d1 100644 --- a/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt +++ b/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt @@ -2,3 +2,8 @@ add_llvm_library(LLVMRuntimeDyld RuntimeDyld.cpp RuntimeDyldMachO.cpp ) + +add_llvm_library_dependencies(LLVMRuntimeDyld + LLVMObject + LLVMSupport + ) diff --git a/lib/Linker/CMakeLists.txt b/lib/Linker/CMakeLists.txt index 0b6d2f4218..4d8824bfcb 100644 --- a/lib/Linker/CMakeLists.txt +++ b/lib/Linker/CMakeLists.txt @@ -4,3 +4,11 @@ add_llvm_library(LLVMLinker LinkModules.cpp Linker.cpp ) + +add_llvm_library_dependencies(LLVMLinker + LLVMArchive + LLVMBitReader + LLVMCore + LLVMSupport + LLVMTransformUtils + ) diff --git a/lib/MC/CMakeLists.txt b/lib/MC/CMakeLists.txt index 9f0a7e8bca..a3303a1bf2 100644 --- a/lib/MC/CMakeLists.txt +++ b/lib/MC/CMakeLists.txt @@ -42,5 +42,10 @@ add_llvm_library(LLVMMC MCTargetAsmLexer.cpp ) +add_llvm_library_dependencies(LLVMMC + LLVMObject + LLVMSupport + ) + add_subdirectory(MCParser) add_subdirectory(MCDisassembler) diff --git a/lib/MC/MCDisassembler/CMakeLists.txt b/lib/MC/MCDisassembler/CMakeLists.txt index 0ce359d4b5..bb7447ccc0 100644 --- a/lib/MC/MCDisassembler/CMakeLists.txt +++ b/lib/MC/MCDisassembler/CMakeLists.txt @@ -1,4 +1,3 @@ - add_llvm_library(LLVMMCDisassembler Disassembler.cpp EDDisassembler.cpp @@ -6,3 +5,44 @@ add_llvm_library(LLVMMCDisassembler EDOperand.cpp EDToken.cpp ) + +add_llvm_library_dependencies(LLVMMCDisassembler + LLVMARMAsmParser + LLVMARMDesc + LLVMARMDisassembler + LLVMARMInfo + LLVMAlphaDesc + LLVMAlphaInfo + LLVMBlackfinDesc + LLVMBlackfinInfo + LLVMCBackendInfo + LLVMCellSPUDesc + LLVMCellSPUInfo + LLVMCppBackendInfo + LLVMMBlazeAsmParser + LLVMMBlazeDesc + LLVMMBlazeDisassembler + LLVMMBlazeInfo + LLVMMC + LLVMMCParser + LLVMMSP430Desc + LLVMMSP430Info + LLVMMipsDesc + LLVMMipsInfo + LLVMPTXDesc + LLVMPTXInfo + LLVMPowerPCDesc + LLVMPowerPCInfo + LLVMSparcDesc + LLVMSparcInfo + LLVMSupport + LLVMSystemZDesc + LLVMSystemZInfo + LLVMTarget + LLVMX86AsmParser + LLVMX86Desc + LLVMX86Disassembler + LLVMX86Info + LLVMXCoreDesc + LLVMXCoreInfo + ) diff --git a/lib/MC/MCParser/CMakeLists.txt b/lib/MC/MCParser/CMakeLists.txt index 222f237bfd..299d281689 100644 --- a/lib/MC/MCParser/CMakeLists.txt +++ b/lib/MC/MCParser/CMakeLists.txt @@ -9,3 +9,8 @@ add_llvm_library(LLVMMCParser MCAsmParserExtension.cpp MCTargetAsmParser.cpp ) + +add_llvm_library_dependencies(LLVMMCParser + LLVMMC + LLVMSupport + ) diff --git a/lib/Object/CMakeLists.txt b/lib/Object/CMakeLists.txt index 68e5e94924..81113934dc 100644 --- a/lib/Object/CMakeLists.txt +++ b/lib/Object/CMakeLists.txt @@ -8,3 +8,8 @@ add_llvm_library(LLVMObject Object.cpp ObjectFile.cpp ) + +add_llvm_library_dependencies(LLVMObject + LLVMCore + LLVMSupport + ) diff --git a/lib/Target/ARM/AsmParser/CMakeLists.txt b/lib/Target/ARM/AsmParser/CMakeLists.txt index 88393e313a..3f5ad39deb 100644 --- a/lib/Target/ARM/AsmParser/CMakeLists.txt +++ b/lib/Target/ARM/AsmParser/CMakeLists.txt @@ -4,4 +4,13 @@ add_llvm_library(LLVMARMAsmParser ARMAsmLexer.cpp ARMAsmParser.cpp ) + add_dependencies(LLVMARMAsmParser ARMCommonTableGen) + +add_llvm_library_dependencies(LLVMARMAsmParser + LLVMARMDesc + LLVMARMInfo + LLVMMC + LLVMMCParser + LLVMSupport + ) diff --git a/lib/Target/ARM/CMakeLists.txt b/lib/Target/ARM/CMakeLists.txt index 8394be52cd..42b450959f 100644 --- a/lib/Target/ARM/CMakeLists.txt +++ b/lib/Target/ARM/CMakeLists.txt @@ -50,6 +50,20 @@ add_llvm_target(ARMCodeGen Thumb2SizeReduction.cpp ) +add_llvm_library_dependencies(LLVMARMCodeGen + LLVMARMAsmPrinter + LLVMARMDesc + LLVMARMInfo + LLVMAnalysis + LLVMAsmPrinter + LLVMCodeGen + LLVMCore + LLVMMC + LLVMSelectionDAG + LLVMSupport + LLVMTarget + ) + # workaround for hanging compilation on MSVC10 if( MSVC_VERSION EQUAL 1600 ) set_property( diff --git a/lib/Target/ARM/Disassembler/CMakeLists.txt b/lib/Target/ARM/Disassembler/CMakeLists.txt index a4238aae54..952dab53ec 100644 --- |