From 89f54ea20319eb77f61341a6ba645c84c3fc4d78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=81oskot?= Date: Sat, 8 Dec 2018 22:08:40 +0100 Subject: [PATCH] [cmake] Add workaround for clean MSVC warning level setting [ci skip] --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca58eb379..80f9b74a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,6 +132,11 @@ endif() add_library(gil_compile_options INTERFACE) target_compile_features(gil_compile_options INTERFACE cxx_std_11) +if(MSVC) + string(REGEX REPLACE "/W3" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) + string(REGEX REPLACE "-W3" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) +endif() + target_compile_options(gil_compile_options INTERFACE $<$:-W4>