From e282382e78e7381fda85894dc588793185ed77d0 Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 18 Dec 2019 18:05:08 +0100 Subject: Warning whit Windows compilation using NMake When using NMake Makefiles on windows we get messages like: ``` D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\vector(960): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc ``` From the help information of `cl`: ``` /EHs enable C++ EH (no SEH exceptions) /EHc extern "C" defaults to nothrow ``` Looking at the usage with the `msbuild / vsxproj` type builds (as done on appveyor), here the option `/EHsc` is used. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ab5aa7..472b90f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,9 @@ if (WIN32) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") # needed for language.cpp on 64bit add_definitions(-DLIBICONV_STATIC -D_CRT_SECURE_NO_WARNINGS) endif() + if (CMAKE_GENERATOR MATCHES "NMake Makefiles") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") + endif() endif() if(POLICY CMP0063) -- cgit v0.12