diff options
author | Jonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de> | 2016-09-21 05:44:06 +0000 |
---|---|---|
committer | Jonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de> | 2016-09-21 05:44:06 +0000 |
commit | 7ddd5998e5e5f628bd8b34aa464194c9d59530bd (patch) | |
tree | 21a8bc951f81e36c056e8bf0836cbce34ed05b0f /cmake/Modules/CompilerRTUtils.cmake | |
parent | 459808139c7498fe6a55a65e367d0eeebeec8f33 (diff) |
[CMake] Rename back SIMPLE_SOURCE to compile as C++
This was changed in rL276151 and causes problems if the C++ compiler does not
support the same arches as the C compiler.
For the builtins, only the C compiler is tested in try_compile_only.
Additionally, -fno-exceptions is passed in (if available) to work around
the case where no libunwind is available.
Differential Revision: https://reviews.llvm.org/D23654
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282054 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/Modules/CompilerRTUtils.cmake')
-rw-r--r-- | cmake/Modules/CompilerRTUtils.cmake | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cmake/Modules/CompilerRTUtils.cmake b/cmake/Modules/CompilerRTUtils.cmake index ba2a7bcfc..3fa50c8ad 100644 --- a/cmake/Modules/CompilerRTUtils.cmake +++ b/cmake/Modules/CompilerRTUtils.cmake @@ -132,8 +132,12 @@ macro(test_target_arch arch def) try_compile_only(CAN_TARGET_${arch} ${TARGET_${arch}_CFLAGS}) else() set(argstring "${CMAKE_EXE_LINKER_FLAGS} ${argstring}") + set(FLAG_NO_EXCEPTIONS "") + if(COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG) + set(FLAG_NO_EXCEPTIONS " -fno-exceptions ") + endif() try_compile(CAN_TARGET_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE} - COMPILE_DEFINITIONS "${TARGET_${arch}_CFLAGS}" + COMPILE_DEFINITIONS "${TARGET_${arch}_CFLAGS} ${FLAG_NO_EXCEPTIONS}" OUTPUT_VARIABLE TARGET_${arch}_OUTPUT CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${argstring}") endif() |