mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 00:32:57 -04:00
CMake: Test for -f(no-)exceptions support before using it
This commit is contained in:
parent
cfa1f043dd
commit
9ee4f1f4e2
@ -92,12 +92,19 @@ set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
|
||||
|
||||
# As long as we're figuring out compiler flags, figure out the flags for
|
||||
# turning C++ exception support on and off
|
||||
include(CheckCXXCompilerFlag)
|
||||
if(MSVC)
|
||||
set(cxx_exceptions_on "/EHsc")
|
||||
set(cxx_exceptions_off "/D_HAS_EXCEPTIONS=0")
|
||||
else()
|
||||
set(cxx_exceptions_on "-fexceptions")
|
||||
set(cxx_exceptions_off "-fno-exceptions")
|
||||
check_cxx_compiler_flag("-fno-exceptions" COMPILER_SUPPORTS_FEXCEPTIONS)
|
||||
if(COMPILER_SUPPORTS_FEXCEPTIONS)
|
||||
set(cxx_exceptions_on "-fexceptions")
|
||||
set(cxx_exceptions_off "-fno-exceptions")
|
||||
else()
|
||||
set(cxx_exceptions_on)
|
||||
set(cxx_exceptions_off)
|
||||
endif()
|
||||
endif()
|
||||
set(cxx_exceptions_property "$<BOOL:$<TARGET_PROPERTY:CXX_EXCEPTIONS>>")
|
||||
add_compile_options(
|
||||
|
Loading…
x
Reference in New Issue
Block a user