OSDN Git Service

Rewrite the CMake build to use explicit dependencies between libraries,
authorChandler Carruth <chandlerc@gmail.com>
Fri, 29 Jul 2011 00:14:25 +0000 (00:14 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 29 Jul 2011 00:14:25 +0000 (00:14 +0000)
commitac03e736c77bcf7e8deb515fc16a7e55d343dc8d
treea44bdf6027c817797e42b65459d3a8ab9d66ad20
parent00eab6c716e206491de195ae4dd85ea493c98582
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
87 files changed:
cmake/modules/AddLLVM.cmake
cmake/modules/CMakeLists.txt
cmake/modules/LLVM-Config.cmake
cmake/modules/LLVMLibDeps.cmake [deleted file]
lib/Analysis/CMakeLists.txt
lib/Analysis/IPA/CMakeLists.txt
lib/Archive/CMakeLists.txt
lib/AsmParser/CMakeLists.txt
lib/Bitcode/Reader/CMakeLists.txt
lib/Bitcode/Writer/CMakeLists.txt
lib/CodeGen/AsmPrinter/CMakeLists.txt
lib/CodeGen/CMakeLists.txt
lib/CodeGen/SelectionDAG/CMakeLists.txt
lib/ExecutionEngine/CMakeLists.txt
lib/ExecutionEngine/Interpreter/CMakeLists.txt
lib/ExecutionEngine/JIT/CMakeLists.txt
lib/ExecutionEngine/MCJIT/CMakeLists.txt
lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt
lib/Linker/CMakeLists.txt
lib/MC/CMakeLists.txt
lib/MC/MCDisassembler/CMakeLists.txt
lib/MC/MCParser/CMakeLists.txt
lib/Object/CMakeLists.txt
lib/Target/ARM/AsmParser/CMakeLists.txt
lib/Target/ARM/CMakeLists.txt
lib/Target/ARM/Disassembler/CMakeLists.txt
lib/Target/ARM/InstPrinter/CMakeLists.txt
lib/Target/ARM/MCTargetDesc/CMakeLists.txt
lib/Target/ARM/TargetInfo/CMakeLists.txt
lib/Target/Alpha/CMakeLists.txt
lib/Target/Alpha/MCTargetDesc/CMakeLists.txt
lib/Target/Alpha/TargetInfo/CMakeLists.txt
lib/Target/Blackfin/CMakeLists.txt
lib/Target/Blackfin/MCTargetDesc/CMakeLists.txt
lib/Target/Blackfin/TargetInfo/CMakeLists.txt
lib/Target/CBackend/CMakeLists.txt
lib/Target/CBackend/TargetInfo/CMakeLists.txt
lib/Target/CMakeLists.txt
lib/Target/CellSPU/CMakeLists.txt
lib/Target/CellSPU/MCTargetDesc/CMakeLists.txt
lib/Target/CellSPU/TargetInfo/CMakeLists.txt
lib/Target/CppBackend/CMakeLists.txt
lib/Target/CppBackend/TargetInfo/CMakeLists.txt
lib/Target/MBlaze/AsmParser/CMakeLists.txt
lib/Target/MBlaze/CMakeLists.txt
lib/Target/MBlaze/Disassembler/CMakeLists.txt
lib/Target/MBlaze/InstPrinter/CMakeLists.txt
lib/Target/MBlaze/MCTargetDesc/CMakeLists.txt
lib/Target/MBlaze/TargetInfo/CMakeLists.txt
lib/Target/MSP430/CMakeLists.txt
lib/Target/MSP430/InstPrinter/CMakeLists.txt
lib/Target/MSP430/MCTargetDesc/CMakeLists.txt
lib/Target/MSP430/TargetInfo/CMakeLists.txt
lib/Target/Mips/CMakeLists.txt
lib/Target/Mips/InstPrinter/CMakeLists.txt
lib/Target/Mips/MCTargetDesc/CMakeLists.txt
lib/Target/Mips/TargetInfo/CMakeLists.txt
lib/Target/PTX/CMakeLists.txt
lib/Target/PTX/MCTargetDesc/CMakeLists.txt
lib/Target/PTX/TargetInfo/CMakeLists.txt
lib/Target/PowerPC/CMakeLists.txt
lib/Target/PowerPC/InstPrinter/CMakeLists.txt
lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt
lib/Target/PowerPC/TargetInfo/CMakeLists.txt
lib/Target/Sparc/CMakeLists.txt
lib/Target/Sparc/MCTargetDesc/CMakeLists.txt
lib/Target/Sparc/TargetInfo/CMakeLists.txt
lib/Target/SystemZ/CMakeLists.txt
lib/Target/SystemZ/MCTargetDesc/CMakeLists.txt
lib/Target/SystemZ/TargetInfo/CMakeLists.txt
lib/Target/X86/AsmParser/CMakeLists.txt
lib/Target/X86/CMakeLists.txt
lib/Target/X86/Disassembler/CMakeLists.txt
lib/Target/X86/InstPrinter/CMakeLists.txt
lib/Target/X86/MCTargetDesc/CMakeLists.txt
lib/Target/X86/TargetInfo/CMakeLists.txt
lib/Target/X86/Utils/CMakeLists.txt
lib/Target/XCore/CMakeLists.txt
lib/Target/XCore/MCTargetDesc/CMakeLists.txt
lib/Target/XCore/TargetInfo/CMakeLists.txt
lib/Transforms/IPO/CMakeLists.txt
lib/Transforms/InstCombine/CMakeLists.txt
lib/Transforms/Instrumentation/CMakeLists.txt
lib/Transforms/Scalar/CMakeLists.txt
lib/Transforms/Utils/CMakeLists.txt
lib/VMCore/CMakeLists.txt
tools/llvm-config/CMakeLists.txt