From 7b7b35d48682c936887b1e12415d2c69ad86a774 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sun, 14 Mar 2021 00:24:45 +0100 Subject: [PATCH] Avoid MSVC compiler warning about C++ exceptions being used The exact warning reads: C++ exception handler used, but unwind semantics are not enabled. Signed-off-by: Johannes Schindelin --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f941598..6c3f530 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,7 @@ if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") set(CMAKE_CXX_FLAGS "-Wall -Wparentheses -Winline -Wbad-function-cast -Wdisabled-optimization -Wextra") else() message(STATUS "MSVC compiler in use") - set(CMAKE_CXX_FLAGS "/Wall /W4") + set(CMAKE_CXX_FLAGS "/Wall /W4 /EHsc") endif() add_compile_definitions(NAPI_CPP_EXCEPTIONS)