mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2026-03-01 13:06:25 +00:00
features.cmake: enable exceptions and RTTI on MSVC
On MSVC, this warning is emitted when including <vector>, among others: warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc clang-cl won't even build without /EHsc and fails on the first try-statement. Since projectM uses the C++ standard library and because it uses exceptions itself, enable the flag. Also, since projectM uses dynamic_cast, enable RTTI. While both /EHsc and /GR are added by CMake by default, user-provided CMAKE_CXX_FLAGS will override the CMake default. So instead of relying on the CMake default, enable them explicitly.
This commit is contained in:
committed by
Kai Blaschke
parent
f40fd3f467
commit
9e5f86b75f
@ -25,6 +25,8 @@ if(NOT MSVC)
|
||||
)
|
||||
else()
|
||||
enable_cflags_if_supported(
|
||||
/EHsc # Exception handling support
|
||||
/GR # RTTI, for dynamic_cast
|
||||
/W4
|
||||
)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user