hanchenye-llvm-project/compiler-rt/cmake
Dan Liew 0bb9b5b481 [CMake] Fix broken uses of `try_compile_only()` and improve the function.
Summary:
There were existing calls to `try_compile_only()` with arguments not
prefixed by `SOURCE` or `FLAGS`. These were silently being ignored.
It looks like the `SOURCE` and `FLAGS` arguments were first introduced
in r278454.

One implication of this is that for a builtins only build for Darwin
(see `darwin_test_archs()`) it would mean we weren't actually passing
`-arch <arch>` to the compiler). This would result in compiler-rt
claiming all supplied architectures could be targetted provided
the compiler could build for Clang's default architecture.

This patch fixes this in several ways.

* Fixes all incorrect calls to `try_compile_only()`.
* Adds code to `try_compile_only()` to check for unhandled arguments
  and raises a fatal error if this occurs. This should stop any
  incorrect calls in the future.
* Improve the documentation on `try_compile_only()` which seemed
  completely wrong.

rdar://problem/48928526

Reviewers: beanz, fjricci, dsanders, kubamracek, yln, dcoughlin

Subscribers: mgorny, jdoerfert, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

Differential Revision: https://reviews.llvm.org/D59429

llvm-svn: 356295
2019-03-15 20:14:46 +00:00
..
Modules [CMake] Fix broken uses of `try_compile_only()` and improve the function. 2019-03-15 20:14:46 +00:00
caches
base-config-ix.cmake [InstrProf] Implement static profdata registration 2019-02-08 19:03:50 +00:00
builtin-config-ix.cmake [macOS] stop generating the libclang_rt.10.4.a library for macOS 10.4 2018-08-08 17:29:55 +00:00
config-ix.cmake Remove esan. 2019-03-11 20:23:40 +00:00