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
This commit is contained in:
Ewan Crawford
2020-03-30 16:44:54 +01:00
committed by GitHub
parent 5e84ad0c19
commit aee0a22ad2
2 changed files with 0 additions and 15 deletions

View File

@@ -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
)