diff --git a/CMakeLists.txt b/CMakeLists.txt index 044ac612..4c685be0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ endif () if (JT_ENABLE_WEB) add_compile_definitions(MUSIC_OGG) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -g --std=c++17 -fpermissive ") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s USE_SDL=2") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='[\"bmp\",\"png\"]'") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s USE_VORBIS=1 -s USE_OGG=1") @@ -33,26 +33,11 @@ if (JT_ENABLE_WEB) "SHELL:-s ALLOW_MEMORY_GROWTH=1" "SHELL:--use-preload-plugins" "SHELL:--preload-file assets") -else () - if (MSVC) - ## disable warnings from external libraries: - ## * 5205 from tileson - ## * 4005 from better enums - ## the warning level for those is set to 4 (disable) while general warning level is 3 - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w45205 /w44005 /W3 /EHsc") - else () - if (NOT CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lstdc++fs") - endif () - if (JT_ENABLE_PERFORMANCETESTS) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra --std=c++17 -fpermissive") - else () - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra --std=c++17 -fpermissive") - endif () - endif () +elseif (MSVC) +elseif (NOT CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lstdc++fs") endif () - ## set include for mac homebrew ##################################################### if (NOT USE_SFML) diff --git a/impl/game/CMakeLists.txt b/impl/game/CMakeLists.txt index da64ba9b..c61d3875 100644 --- a/impl/game/CMakeLists.txt +++ b/impl/game/CMakeLists.txt @@ -8,4 +8,13 @@ endif () target_link_libraries(${PROJECTNAME} GameLib) target_include_directories(${PROJECTNAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +if (MSVC) + target_compile_options(${PROJECTNAME} PRIVATE "/W3") + target_compile_options(${PROJECTNAME} PRIVATE "/EHsc") +else () + target_compile_options(${PROJECTNAME} PRIVATE "-Wall") + target_compile_options(${PROJECTNAME} PRIVATE "-Wextra") +endif () + + jt_use_assets(${PROJECTNAME}) diff --git a/impl/gamelib/CMakeLists.txt b/impl/gamelib/CMakeLists.txt index cd047576..6923f02d 100644 --- a/impl/gamelib/CMakeLists.txt +++ b/impl/gamelib/CMakeLists.txt @@ -7,4 +7,11 @@ endif () target_link_libraries(GameLib PUBLIC JamTemplateLib) target_include_directories(GameLib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +if (MSVC) + target_compile_options(GameLib PRIVATE "/W3") + target_compile_options(GameLib PRIVATE "/EHsc") +else () + target_compile_options(GameLib PRIVATE "-Wall") + target_compile_options(GameLib PRIVATE "-Wextra") +endif () diff --git a/impl/gamelib/player/sound/sound_component_impl.cpp b/impl/gamelib/player/sound/sound_component_impl.cpp index cfdb798d..aad07973 100644 --- a/impl/gamelib/player/sound/sound_component_impl.cpp +++ b/impl/gamelib/player/sound/sound_component_impl.cpp @@ -4,17 +4,17 @@ #include