Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checked in a better fix based on code review #3896

Merged
merged 6 commits into from
Jun 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions src/Native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,12 @@ set(RESOURCES)
include_directories("${CMAKE_BINARY_DIR}/../../")

if(WIN32)
# Clobber and reset the default C and CXX flags because
# CMake uses /ZI (Edit and Continue) for generating pdbs
# which is incompatible with the /guard:cf flag we set below
# for security. So we use the default flags set by CMake
# and reset /ZI with /Zi
# There seems to be a bug in the latest VS2019
# which is adding /ZI (which conflicts with /guard:cf) instead of /Zi.
message("CMAKE_C_FLAGS_DEBUG is ${CMAKE_C_FLAGS_DEBUG}")
message("CMAKE_CXX_FLAGS_DEBUG is ${CMAKE_CXX_FLAGS_DEBUG}")
message("In a future version, If the default compiler flags no longer contain the /ZI flag, delete this message block and the two lines below.")
set(CMAKE_C_FLAGS_DEBUG "/MDd /Zi /Ob0 /Od /RTC1 /JMC")
set(CMAKE_CXX_FLAGS_DEBUG "/MDd /Zi /Ob0 /Od /RTC1 /JMC")
message("In a future version, if the CMake that ships with VS2019 no longer contains the /ZI flag, delete this message block and the two lines below.")
string(REPLACE "/ZI" "/Zi" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
string(REPLACE "/ZI" "/Zi" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})

add_definitions(-DWIN32)
add_definitions(-D_WIN32=1)
Expand Down