CMakeLists.txt 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. cmake_minimum_required(VERSION 3.25)
  2. project(inverting_game C)
  3. set(CMAKE_C_STANDARD 23)
  4. set(SRC
  5. "src/Control.c"
  6. "src/GameEngine.c"
  7. "src/Main.c"
  8. "src/Vector3D.c"
  9. )
  10. set(WARNINGS
  11. -Wno-attributes
  12. -Wall
  13. -Walloc-zero
  14. -Walloca
  15. -Wanalyzer-too-complex
  16. -Warith-conversion
  17. -Warray-bounds=2
  18. -Warray-parameter
  19. -Wattribute-alias=2
  20. -Wbad-function-cast
  21. -Wbidi-chars=any
  22. -Wcast-align=strict
  23. -Wcast-qual
  24. -Wconversion
  25. -Wdate-time
  26. -Wdisabled-optimization
  27. -Wdouble-promotion
  28. -Wduplicated-branches
  29. -Wduplicated-cond
  30. -Wenum-compare
  31. -Wenum-conversion
  32. -Werror
  33. -Wextra
  34. -Wfloat-equal
  35. -Wformat-overflow=2
  36. -Wformat-signedness
  37. -Wformat-truncation=2
  38. -Wformat=2
  39. -Wframe-larger-than=8388608
  40. -Wimplicit-fallthrough=5
  41. -Winfinite-recursion
  42. -Winit-self
  43. -Winvalid-pch
  44. -Wjump-misses-init
  45. -Wlarger-than=1073741824
  46. -Wlogical-op
  47. -Wmissing-braces
  48. -Wmissing-declarations
  49. -Wmissing-include-dirs
  50. -Wmissing-prototypes
  51. -Wmultichar
  52. -Wnarrowing
  53. -Wnested-externs
  54. -Wnormalized=nfkc
  55. -Wnull-dereference
  56. -Wold-style-definition
  57. -Woverlength-strings
  58. -Wredundant-decls
  59. -Wshadow
  60. -Wshift-overflow=2
  61. -Wsign-conversion
  62. -Wstack-protector
  63. -Wstack-usage=8388608
  64. -Wstrict-overflow=2
  65. -Wstrict-prototypes
  66. -Wstringop-overflow=4
  67. -Wswitch-enum
  68. -Wtrampolines
  69. -Wtrivial-auto-var-init
  70. -Wundef
  71. -Wunreachable-code
  72. -Wunused-const-variable=2
  73. -Wuse-after-free=3
  74. -Wvla
  75. -Wwrite-strings
  76. -pedantic
  77. -pedantic-errors
  78. )
  79. add_executable(inverting_game ${SRC})
  80. target_compile_options(inverting_game PRIVATE
  81. ${WARNINGS}
  82. -fdiagnostics-color=always
  83. )
  84. target_link_libraries(inverting_game PRIVATE
  85. m
  86. GLEW
  87. glfw
  88. GL
  89. )