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
This commit is contained in:
Leonid Yuriev 2020-06-12 11:56:38 +03:00
parent 7ab9d24d3b
commit 753cd8fec1

View File

@ -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)