From 753cd8fec1c665fc403fb201e718269993fa0416 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Fri, 12 Jun 2020 11:56:38 +0300 Subject: [PATCH] mdbx-cmake: fix using check_cxx_compiler_flag() when C++ compiler don't used/loaded. Fixes https://github.com/erthink/libmdbx/issues/111 Change-Id: I53cfff2627469e857dcdfc303de4bb1c8ba4e82b --- cmake/compiler.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)