OSDN Git Service

[CMake] Produce an empty library for GlobalISel when not building it.
authorQuentin Colombet <qcolombet@apple.com>
Thu, 11 Feb 2016 19:18:27 +0000 (19:18 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Thu, 11 Feb 2016 19:18:27 +0000 (19:18 +0000)
commit317e76f08d50846119bced5e2d979f8337ddfef0
tree4b96d466bc4137bf2757c9bdf6a78a107724838d
parent07b147db30d03b1a98cd3d488961e1cebc6ba835
[CMake] Produce an empty library for GlobalISel when not building it.
The rational for this change is that LLVMBuild cannot express conditional
dependencies. Therefore, when we start optionally using GlobalISel library for
say AArch64, without that change, all the tools that use the AArch64 library
would need to explicitly link with GlobalISel when we ask for it.

This does not scale.

Instead, we will set the dependencies between the target and GlobalISel and if
we did not ask to build GlobalISel, the library will just be empty.

Thanks to Chris Bieneman and Mehdi Animi for the idea.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260566 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CMakeLists.txt
lib/CodeGen/GlobalISel/CMakeLists.txt
lib/CodeGen/GlobalISel/EmptyFile.cpp [new file with mode: 0644]
tools/llc/CMakeLists.txt