Skip to content

Commit

Permalink
Fix MSVC debug
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Apr 30, 2024
1 parent 8b7b577 commit e19977e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -356,15 +356,17 @@ if(GCC OR CLANG)
endif()

set(C_CXX_FLAGS "${C_CXX_FLAGS} -Werror -Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings")
if(!MSVC)
if(EMSCRIPTEN)
# emscripten's emcc/clang does not accept the "-ggdb" flag.
set(C_CXX_FLAGS "${C_CXX_FLAGS} -g")
if(CMAKE_BUILD_TYPE_LOWER STREQUAL "debug" OR CMAKE_BUILD_TYPE_LOWER STREQUAL "relwithdebinfo")
if (MSVC)
set(C_CXX_FLAGS "${C_CXX_FLAGS} /Zi")
else()
set(C_CXX_FLAGS "${C_CXX_FLAGS} -ggdb")
if(EMSCRIPTEN)
# emscripten's emcc/clang does not accept the "-ggdb" flag.
set(C_CXX_FLAGS "${C_CXX_FLAGS} -g")
else()
set(C_CXX_FLAGS "${C_CXX_FLAGS} -ggdb")
endif()
endif()

set(C_CXX_FLAGS "${C_CXX_FLAGS} -Wall -fvisibility=hidden -fno-common")
endif()

if(CLANG)
Expand Down

0 comments on commit e19977e

Please sign in to comment.