OSDN Git Service

[cmake] Pass TARGETS_TO_BUILD through to host tools build
authorJustin Bogner <mail@justinbogner.com>
Mon, 11 Dec 2017 19:53:23 +0000 (19:53 +0000)
committerJustin Bogner <mail@justinbogner.com>
Mon, 11 Dec 2017 19:53:23 +0000 (19:53 +0000)
commit9b89282304887fe84d17dd9cb693774e50c9027b
tree4064b041b1e3616072b216ecc11787a781c93f29
parent1559083a44c32e2d1a70ef9bc5a4942414b4469a
[cmake] Pass TARGETS_TO_BUILD through to host tools build

In r319620, the host build was changed to use Native for
TARGETS_TO_BUILD because passing semicolons through add_custom_command
is surprisingly difficult. However, Native really doesn't make any
sense here, and it only works because we don't technically do any
codegen in the host tools so pretty well anything will "work".

The problem here is that passing something other than the correct
value is very fragile - as evidence note how the llvm-config in the
host tools acts differently than the target one now, and misreports
the targets to build. Similarly, if there is any logic conditional on
the targets in tablegen (now or in the future), it will do the wrong
thing.

To fix this, we need to escape the semicolons in the targets string
and pass it through to the child cmake invocation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320413 91177308-0d34-0410-b5e6-96231b3b80d8
cmake/modules/CrossCompile.cmake