Skip to content

Commit

Permalink
Add Windows compilation support
Browse files Browse the repository at this point in the history
Linked: #12
  • Loading branch information
AndreasLrx committed May 11, 2022
1 parent c95f225 commit cf81d15
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

# Executable
/bomberman
/bomberman.exe

# Shame on you!
vgcore.*
28 changes: 19 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,29 @@ find_package(raylib REQUIRED)
# Unit testing
if (BUILD_TEST_SUITE)
# Check for criterion
find_package(Criterion REQUIRED)
enable_testing()
find_package(Criterion)
if (CRITERION_FOUND)
enable_testing()
endif()
endif()

add_compile_options(
"-Wall" "-Wextra" "-Wshadow" "-pedantic" "-Wpointer-arith" "-Wsuggest-final-methods"
"-Wsuggest-final-types" "-Wsuggest-override"
"$<$<CONFIG:RELEASE>:-O3;-Werror>"
"$<$<CONFIG:DEBUG>:-O0;-g3;-ggdb>"
)
# Enable Warnings
if (MSVC)
add_compile_options(
"/W4"
"/WX"
)
else()
add_compile_options(
"-Wall" "-Wextra" "-Wshadow" "-pedantic" "-Wpointer-arith"
"-Wsuggest-final-methods" "-Wsuggest-final-types" "-Wsuggest-override"
"$<$<CONFIG:RELEASE>:-O3;-Werror>"
"$<$<CONFIG:DEBUG>:-O0;-g3;-ggdb>"
)
endif()

add_subdirectory(src)

if (BUILD_TEST_SUITE)
if ((BUILD_TEST_SUITE) AND (CRITERION_FOUND))
add_subdirectory(tests)
endif()
9 changes: 9 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
"name": "unix_makefiles",
"hidden": true,
"generator": "Unix Makefiles",
"architecture": {
"strategy": "external",
"value": "arm64"
},
"generator": "Visual Studio 16 2019",
"architecture": {
"strategy": "set",
"value": "Win32"
},
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
Expand Down

0 comments on commit cf81d15

Please sign in to comment.