diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e2e7327 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/out diff --git a/CMakeLists.txt b/CMakeLists.txt index bb9e241..1533b8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,19 +88,26 @@ target_include_directories(${PROJECT_NAME} PRIVATE ) if(MSVC) + # By default, MSVC may add /EHsc to CMAKE_CXX_FLAGS, which we don't want (we use /EHs below) + string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) + + # By default, MSVC may add /W3 to CMAKE_CXX_FLAGS, which we don't want (we use /W4 below) + # Note that this is not required with "cmake_minimum_required(VERSION 3.15)" or later + string(REPLACE "/W3" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) + # On Win32, we need NOGDI and NOUSER to be able to define some Mac functions # whose names are otherwise taken by Windows APIs. target_compile_definitions(${PROJECT_NAME} PRIVATE WIN32_LEAN_AND_MEAN NOGDI NOUSER) target_compile_options(${PROJECT_NAME} PRIVATE - /EHa + /EHs # synchronous exceptions; also, extern "C" functions may throw exceptions /W4 /wd4068 # ignore unrecognized pragmas /wd4100 # unreferenced formal parameter /wd4201 # nonstandard extension /wd4244 # conversion from double to float /wd4458 # declaration of variable hides class member - /MP + /MP # multiprocessor compilation ) else() target_compile_options(${PROJECT_NAME} PRIVATE