llvm-project/compiler-rt/cmake/Modules
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
..
CustomLibcxx [compiler-rt][CMake] Set project for the custom libc++ 2019-02-19 16:53:33 +00:00
AddCompilerRT.cmake [TSan][libdispatch] Enable linking and running of tests on Linux 2019-03-15 17:52:27 +00:00
BuiltinTests.cmake [CMake] Fix broken uses of `try_compile_only()` and improve the function. 2019-03-15 20:14:46 +00:00
CompilerRTCompile.cmake [CMake] Avoid clang dependencies in the runtimes build 2019-02-13 06:49:47 +00:00
CompilerRTDarwinUtils.cmake [CMake] Fix broken uses of `try_compile_only()` and improve the function. 2019-03-15 20:14:46 +00:00
CompilerRTLink.cmake Make cmake link flag naming consistent 2017-01-10 04:33:04 +00:00
CompilerRTUtils.cmake [CMake] Fix broken uses of `try_compile_only()` and improve the function. 2019-03-15 20:14:46 +00:00
HandleCompilerRT.cmake [CMake] Add a missing case of TO_CMAKE_PATH 2018-11-27 09:23:15 +00:00
SanitizerUtils.cmake sanitizer_common: Change gen_dynamic_list.py to take a -o argument instead of writing to stdout. 2019-01-11 23:30:24 +00:00