diff options
author | Petr Hosek <phosek@chromium.org> | 2018-10-31 22:40:25 +0000 |
---|---|---|
committer | Petr Hosek <phosek@chromium.org> | 2018-10-31 22:40:25 +0000 |
commit | fea925bcc3c67abf4b5831d6ab93531b2ffdf770 (patch) | |
tree | f12234a4c126c188927aa498a357901ff4ce3dee | |
parent | e2d331d3f6a99ad54b98a0bd09cfb124c88b7feb (diff) | |
download | compiler-rt-fea925bcc3c67abf4b5831d6ab93531b2ffdf770.tar.gz |
[compiler-rt] Pass CMake C and C++ flags to the custom libc++
When building the custom libc++ that's used by libFuzzer as well as
MSan and TSan tests, passthrough the C and C++ flags that were passed
to the compiler-rt CMake build. These may be needed to successfuly
compile the library on a particular platform.
Differential Revision: https://reviews.llvm.org/D53862
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@345788 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | cmake/Modules/AddCompilerRT.cmake | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake index c91565ff7..f6142f842 100644 --- a/cmake/Modules/AddCompilerRT.cmake +++ b/cmake/Modules/AddCompilerRT.cmake @@ -568,9 +568,13 @@ macro(add_custom_libcxx name prefix) endif() endforeach() - string(REPLACE ";" " " FLAGS_STRING "${LIBCXX_CFLAGS}") - set(LIBCXX_C_FLAGS "${FLAGS_STRING}") - set(LIBCXX_CXX_FLAGS "${FLAGS_STRING}") + string(REPLACE ";" " " LIBCXX_C_FLAGS "${LIBCXX_CFLAGS}") + get_property(C_FLAGS CACHE CMAKE_C_FLAGS PROPERTY VALUE) + set(LIBCXX_C_FLAGS "${LIBCXX_C_FLAGS} ${C_FLAGS}") + + string(REPLACE ";" " " LIBCXX_CXX_FLAGS "${LIBCXX_CFLAGS}") + get_property(CXX_FLAGS CACHE CMAKE_CXX_FLAGS PROPERTY VALUE) + set(LIBCXX_CXX_FLAGS "${LIBCXX_CXX_FLAGS} ${CXX_FLAGS}") ExternalProject_Add(${name} DEPENDS ${name}-clobber ${LIBCXX_DEPS} |