2D Run-and-gun shooter inspired by One Man's Doomsday, Counter-Strike, and Metal Slug.
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

261 wiersze
9.0 KiB

  1. cmake_minimum_required(VERSION 3.21)
  2. # Set your project name here
  3. project(izanagi C)
  4. set(CMAKE_C_STANDARD 11)
  5. if (WIN32)
  6. if (CMAKE_SIZEOF_VOID_P EQUAL 8)
  7. set(PROJECT_ARCH x64)
  8. else ()
  9. set(PROJECT_ARCH x86)
  10. endif ()
  11. endif ()
  12. add_definitions(
  13. -DIZ_APP_NAME="Izanagi"
  14. -DIZ_APP_DESCRIPTION="Run and gun game"
  15. -DIZ_APP_SERVER_DESCRIPTION="Dedicated server"
  16. -DIZ_PLAYERS=1
  17. )
  18. if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
  19. add_definitions(-DIZ_DEBUG)
  20. endif()
  21. include_directories(
  22. "${PROJECT_SOURCE_DIR}/dependencies/SDL2/include"
  23. "${PROJECT_SOURCE_DIR}/dependencies/minIni/dev"
  24. "${PROJECT_SOURCE_DIR}/dependencies/bdd-for-c"
  25. "${PROJECT_SOURCE_DIR}/dependencies/portmidi/pm_common"
  26. "${PROJECT_SOURCE_DIR}/dependencies/spine-runtimes/spine-c/spine-c/include"
  27. "${PROJECT_SOURCE_DIR}/dependencies/getopt-for-windows"
  28. "${PROJECT_SOURCE_DIR}/dependencies/libwebsockets/build/include"
  29. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/include"
  30. "${PROJECT_SOURCE_DIR}/dependencies/sqlite"
  31. )
  32. link_directories(
  33. "${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}"
  34. "${PROJECT_SOURCE_DIR}/dependencies/portmidi/Release"
  35. "${PROJECT_SOURCE_DIR}/dependencies/libwebsockets/build/lib/Release"
  36. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/lib"
  37. )
  38. add_executable(
  39. game
  40. dependencies/minIni/dev/minIni.h
  41. dependencies/minIni/dev/minIni.c
  42. dependencies/getopt-for-windows/getopt.h
  43. dependencies/getopt-for-windows/getopt.c
  44. src/packages/game/output/video/IZ_video.h
  45. src/packages/game/output/video/IZ_video.c
  46. src/packages/game/IZ_common.h
  47. src/packages/game/input/IZ_action.h
  48. src/packages/game/IZ_app.h
  49. src/packages/game/IZ_app.c
  50. src/packages/game/main.c
  51. src/packages/game/input/IZ_joystick.c
  52. src/packages/game/input/IZ_joystick.h
  53. src/packages/game/input/IZ_keyboard.c
  54. src/packages/game/input/IZ_keyboard.h
  55. src/packages/game/IZ_config.c
  56. src/packages/game/IZ_config.h
  57. src/packages/game/geometry/IZ_point2d.c
  58. src/packages/game/geometry/IZ_point2d.h
  59. src/packages/game/geometry/IZ_vector2d.c
  60. src/packages/game/geometry/IZ_vector2d.h
  61. src/packages/game/geometry/IZ_rect.c
  62. src/packages/game/geometry/IZ_rect.h
  63. src/packages/game/core/IZ_object.c
  64. src/packages/game/core/IZ_object.h
  65. src/packages/game/core/IZ_creature.c
  66. src/packages/game/core/IZ_creature.h
  67. src/packages/game/core/IZ_entity.c
  68. src/packages/game/core/IZ_entity.h
  69. src/packages/game/memory/IZ_pool.c
  70. src/packages/game/memory/IZ_pool.h
  71. src/packages/game/input/IZ_input.c
  72. src/packages/game/input/IZ_input.h
  73. src/packages/game/input/IZ_midi.c
  74. src/packages/game/input/IZ_midi.h
  75. src/packages/game/data/IZ_list.c
  76. src/packages/game/data/IZ_list.h
  77. src/packages/game/net/svc/IZ_wsclient.c
  78. src/packages/game/net/svc/IZ_wsclient.h
  79. src/packages/game/log/IZ_log.c
  80. src/packages/game/log/IZ_log.h
  81. src/packages/game/util/IZ_midi.c
  82. src/packages/game/util/IZ_midi.h
  83. src/packages/game/net/core/IZ_websocket.h
  84. src/packages/game/net/core/IZ_websocket.c
  85. src/packages/game/net/IZ_net.c src/packages/game/net/IZ_net.h src/packages/game/net/IZ_app.c src/packages/game/net/IZ_app.h src/packages/game/output/video/IZ_app.c src/packages/game/output/video/IZ_app.h src/packages/game/IZ_subsystem.h src/packages/game/input/IZ_app.c src/packages/game/input/IZ_app.h)
  86. target_link_libraries(
  87. game
  88. SDL2main
  89. SDL2
  90. portmidi
  91. libcrypto
  92. libssl
  93. websockets
  94. )
  95. add_executable(
  96. game-test-geometry
  97. dependencies/bdd-for-c/bdd-for-c.h
  98. src/packages/test/IZ_mock.h
  99. src/packages/test/IZ_test.h
  100. src/packages/game/geometry/IZ_point2d.h
  101. src/packages/game/geometry/IZ_point2d.c
  102. src/packages/game/geometry/IZ_rect.h
  103. src/packages/game/geometry/IZ_rect.c
  104. src/packages/game/geometry/IZ_vector2d.h
  105. src/packages/game/geometry/IZ_vector2d.c
  106. src/packages/game/geometry/geometry.test.c
  107. )
  108. add_executable(
  109. game-test-input
  110. dependencies/bdd-for-c/bdd-for-c.h
  111. src/packages/test/IZ_mock.h
  112. src/packages/test/IZ_test.h
  113. __mocks__/minIni.mock.h
  114. __mocks__/SDL_keyboard.mock.h
  115. __mocks__/SDL_events.mock.h
  116. __mocks__/SDL_joystick.mock.h
  117. __mocks__/SDL_stdinc.mock.h
  118. __mocks__/portmidi.mock.h
  119. src/packages/game/IZ_config.h
  120. src/packages/game/input/IZ_keyboard.h
  121. src/packages/game/input/IZ_keyboard.c
  122. src/packages/game/input/IZ_joystick.h
  123. src/packages/game/input/IZ_joystick.c
  124. src/packages/game/input/IZ_midi.h
  125. src/packages/game/input/IZ_midi.c
  126. src/packages/game/util/IZ_midi.c
  127. src/packages/game/util/IZ_midi.h
  128. src/packages/game/input/input.test.c
  129. )
  130. add_executable(
  131. game-test-output
  132. dependencies/bdd-for-c/bdd-for-c.h
  133. src/packages/test/IZ_mock.h
  134. src/packages/test/IZ_test.h
  135. __mocks__/minIni.mock.h
  136. __mocks__/SDL_stdinc.mock.h
  137. __mocks__/SDL_render.mock.h
  138. src/packages/game/IZ_config.h
  139. src/packages/game/output/video/IZ_video.h
  140. src/packages/game/output/video/IZ_video.c
  141. src/packages/game/output/output.test.c
  142. )
  143. add_executable(
  144. game-test-memory
  145. dependencies/bdd-for-c/bdd-for-c.h
  146. src/packages/test/IZ_mock.h
  147. src/packages/test/IZ_test.h
  148. src/packages/game/memory/IZ_pool.h
  149. src/packages/game/memory/IZ_pool.c
  150. src/packages/game/memory/memory.test.c
  151. src/packages/game/data/IZ_list.c
  152. src/packages/game/data/IZ_list.h
  153. )
  154. add_executable(
  155. game-test-data
  156. dependencies/bdd-for-c/bdd-for-c.h
  157. src/packages/test/IZ_mock.h
  158. src/packages/test/IZ_test.h
  159. src/packages/game/data/IZ_list.h
  160. src/packages/game/data/IZ_list.c
  161. src/packages/game/data/data.test.c
  162. )
  163. add_executable(
  164. server
  165. dependencies/sqlite/sqlite3.h
  166. dependencies/sqlite/sqlite3.c
  167. dependencies/minIni/dev/minIni.h
  168. dependencies/minIni/dev/minIni.c
  169. src/packages/server/IZ_common.h
  170. src/packages/server/log/IZ_log.h
  171. src/packages/server/log/IZ_log.c
  172. src/packages/server/main.c
  173. src/packages/server/IZ_app.c
  174. src/packages/server/IZ_app.h
  175. src/packages/server/IZ_config.c
  176. src/packages/server/IZ_config.h
  177. src/packages/server/net/svc/IZ_wsserver.c
  178. src/packages/server/net/svc/IZ_wsserver.h
  179. src/packages/server/net/core/IZ_websocket.h
  180. src/packages/server/net/core/IZ_websocket.c
  181. src/packages/server/net/IZ_net.c src/packages/server/net/IZ_net.h src/packages/server/db/IZ_repo.c src/packages/server/db/IZ_repo.h)
  182. target_link_libraries(
  183. server
  184. SDL2main
  185. SDL2
  186. libcrypto
  187. libssl
  188. websockets
  189. )
  190. if (WIN32)
  191. add_custom_command(TARGET game POST_BUILD
  192. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  193. "${PROJECT_SOURCE_DIR}/dependencies/SDL2/lib/${PROJECT_ARCH}/SDL2.dll" # <--this is in-file
  194. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  195. add_custom_command(TARGET game POST_BUILD
  196. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  197. "${PROJECT_SOURCE_DIR}/dependencies/portmidi/Release/portmidi.dll" # <--this is in-file
  198. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  199. add_custom_command(TARGET game POST_BUILD
  200. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  201. "${PROJECT_SOURCE_DIR}/dependencies/libwebsockets/build/bin/Release/websockets.dll" # <--this is in-file
  202. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  203. add_custom_command(TARGET game POST_BUILD
  204. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  205. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/bin/libssl-1_1-x64.dll" # <--this is in-file
  206. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  207. add_custom_command(TARGET game POST_BUILD
  208. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  209. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/bin/libcrypto-1_1-x64.dll" # <--this is in-file
  210. $<TARGET_FILE_DIR:game>) # <--this is out-file path
  211. add_custom_command(TARGET server POST_BUILD
  212. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  213. "${PROJECT_SOURCE_DIR}/dependencies/libwebsockets/build/bin/Release/websockets.dll" # <--this is in-file
  214. $<TARGET_FILE_DIR:server>) # <--this is out-file path
  215. add_custom_command(TARGET server POST_BUILD
  216. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  217. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/bin/libssl-1_1-x64.dll" # <--this is in-file
  218. $<TARGET_FILE_DIR:server>) # <--this is out-file path
  219. add_custom_command(TARGET server POST_BUILD
  220. COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E copy_if_different..."
  221. "${PROJECT_SOURCE_DIR}/dependencies/openssl/${PROJECT_ARCH}/bin/libcrypto-1_1-x64.dll" # <--this is in-file
  222. $<TARGET_FILE_DIR:server>) # <--this is out-file path
  223. endif ()