[compiler-rt][Darwin] Fix linker errors for check-asan
authorJulian Lettner <julian.lettner@apple.com>
Fri, 31 Jul 2020 23:09:13 +0000 (16:09 -0700)
committerJulian Lettner <julian.lettner@apple.com>
Fri, 31 Jul 2020 23:43:21 +0000 (16:43 -0700)
commitff756f5231cc2ee9457129404e78420fa2791c7b
tree0452c3f83a8fb21b1e2ea9b5a7ae41cb7501d696
parent721d93fc5aa8c9f9fc9b86a9d3d1a58c6790213e
[compiler-rt][Darwin] Fix linker errors for check-asan

A recent change broke `ninja check-asan` on Darwin by causing an error
during linking of ASan unit tests [1].

Move the addition of `-ObjC` compiler flag outside of the new
`if(COMPILER_RT_STANDALONE_BUILD)` block.  It doesn't add any global
flags (e.g, `${CMAKE_CXX_FLAGS}`) and the decision to add is based
solely on source paths (`${source_rpath}`).

[1] 8b2fcc42b895, https://reviews.llvm.org/D84466

Differential Revision: https://reviews.llvm.org/D85057
compiler-rt/cmake/Modules/CompilerRTCompile.cmake