diff --git a/cmake/compiler.cmake b/cmake/compiler.cmake index 48950f24..0a4ca9b9 100644 --- a/cmake/compiler.cmake +++ b/cmake/compiler.cmake @@ -210,7 +210,9 @@ else() check_compiler_flag("-Wextra" CC_HAS_WEXTRA) check_compiler_flag("-Werror" CC_HAS_WERROR) check_compiler_flag("-fexceptions" CC_HAS_FEXCEPTIONS) - check_cxx_compiler_flag("-fcxx-exceptions" CC_HAS_FCXX_EXCEPTIONS) + if(CMAKE_CXX_COMPILER_LOADED) + check_cxx_compiler_flag("-fcxx-exceptions" CC_HAS_FCXX_EXCEPTIONS) + endif() check_compiler_flag("-funwind-tables" CC_HAS_FUNWIND_TABLES) check_compiler_flag("-fno-omit-frame-pointer" CC_HAS_FNO_OMIT_FRAME_POINTER) check_compiler_flag("-fno-common" CC_HAS_FNO_COMMON)