From 4d2b9dc24c2af69518cf937c5b8aaefd7d343321 Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Thu, 11 Jul 2019 21:57:06 +0200 Subject: [PATCH] [cmake] enable exception handling on windows Needed to avoid build errors with boost exception and MSVC. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 22dfbf0c..10bbc1ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,10 @@ if(CCTAG_ENABLE_SIMD_AVX2) message(STATUS "CCTAG: AVX2 optimizations enabled.") endif() +if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + add_definitions(/EHsc) # Enable Exception Handling +endif() + # load local machine config .cmake site_name(MACHINE_NAME)