From aee0a22ad2b92e9fd6d72d92d996c31ada677a39 Mon Sep 17 00:00:00 2001 From: Ewan Crawford Date: Mon, 30 Mar 2020 16:44:54 +0100 Subject: [PATCH] Preserve existing release flags in MSVC (#704) * Preserve existing release flags in MSVC Without this the `/MD` flag is lost on Release builds, resulting in the below error when using a Ninja CMake generator with VS2019 compiler. Before replacement `/MD /O2 /Ob2 /DNDEBUG`, after replace `/MD /Od /Ob0 /DNDEBUG` ``` harness.lib(testHarness.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in test_conversions.cpp.obj ``` * Remove Visual Studio 2005 release flag workarounds --- test_conformance/conversions/CMakeLists.txt | 9 --------- test_conformance/geometrics/CMakeLists.txt | 6 ------ 2 files changed, 15 deletions(-) diff --git a/test_conformance/conversions/CMakeLists.txt b/test_conformance/conversions/CMakeLists.txt index 307993a1..2dd0d838 100644 --- a/test_conformance/conversions/CMakeLists.txt +++ b/test_conformance/conversions/CMakeLists.txt @@ -1,14 +1,5 @@ set(MODULE_NAME CONVERSIONS) -# VS2005 AMD64 WAR (basic_test_conversions.cpp causes internal compiler error) -if(MSVC) -set(CMAKE_C_FLAGS_RELEASE "/Od /Ob0") -set(CMAKE_CXX_FLAGS_RELEASE "/Od /Ob0") -else(MSVC) -set(CMAKE_C_FLAGS_RELEASE "-O0") -set(CMAKE_CXX_FLAGS_RELEASE "-O0") -endif(MSVC) - set (${MODULE_NAME}_SOURCES Sleep.cpp test_conversions.cpp basic_test_conversions.cpp ) diff --git a/test_conformance/geometrics/CMakeLists.txt b/test_conformance/geometrics/CMakeLists.txt index a461fa42..3fee05fb 100644 --- a/test_conformance/geometrics/CMakeLists.txt +++ b/test_conformance/geometrics/CMakeLists.txt @@ -6,11 +6,5 @@ set(${MODULE_NAME}_SOURCES test_geometrics.cpp ) -# VS2005 optimization WAR for geom_length) -if(MSVC) -set(CMAKE_C_FLAGS_RELEASE "/Od /Ob0") -set(CMAKE_CXX_FLAGS_RELEASE "/Od /Ob0") -endif(MSVC) - include(../CMakeCommon.txt)