CMakeLists.txt 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. cmake_minimum_required(VERSION 3.25)
  2. project(core)
  3. set(CMAKE_CXX_STANDARD 20)
  4. set(SRC
  5. "src/utils/Logger.cpp"
  6. "src/utils/Utility.cpp"
  7. "src/utils/Error.cpp"
  8. "src/utils/New.cpp"
  9. "src/utils/Buffer.cpp"
  10. "src/utils/Clock.cpp"
  11. "src/utils/Random.cpp"
  12. "src/data/BitArray.cpp"
  13. "src/math/Math.cpp"
  14. "src/math/Vector.cpp"
  15. "src/math/Quaternion.cpp"
  16. "src/math/Matrix.cpp"
  17. "src/math/Box.cpp"
  18. "src/math/Plane.cpp"
  19. "src/math/Frustum.cpp"
  20. "src/math/View.cpp"
  21. "src/thread/Thread.cpp"
  22. "src/io/FileReader.cpp"
  23. )
  24. set(SRC_TESTS
  25. "src/test/Main.cpp"
  26. "src/test/Test.cpp"
  27. "src/tests/ArrayTests.cpp"
  28. "src/tests/ArrayStringTests.cpp"
  29. "src/tests/UtilityTests.cpp"
  30. "src/tests/ArrayListTests.cpp"
  31. "src/tests/BitArrayTests.cpp"
  32. "src/tests/MathTests.cpp"
  33. "src/tests/ListTests.cpp"
  34. "src/tests/LinkedListTests.cpp"
  35. "src/tests/UniquePointerTests.cpp"
  36. "src/tests/HashMapTests.cpp"
  37. "src/tests/ProbingHashMapTests.cpp"
  38. "src/tests/StackTests.cpp"
  39. "src/tests/RingBufferTests.cpp"
  40. "src/tests/ComponentsTests.cpp"
  41. "src/tests/VectorTests.cpp"
  42. "src/tests/QuaternionTests.cpp"
  43. "src/tests/MatrixTests.cpp"
  44. "src/tests/BoxTests.cpp"
  45. "src/tests/BufferedValueTests.cpp"
  46. "src/tests/PlaneTests.cpp"
  47. "src/tests/FrustumTests.cpp"
  48. "src/tests/ViewTests.cpp"
  49. "src/tests/MatrixStackTests.cpp"
  50. "src/tests/ColorTests.cpp"
  51. "src/tests/BufferTests.cpp"
  52. "src/tests/ClockTests.cpp"
  53. "src/tests/RandomTests.cpp"
  54. "src/tests/ThreadTests.cpp"
  55. "src/tests/FileReaderTests.cpp"
  56. )
  57. set(SRC_PERFORMANCE
  58. "src/performance/Main.cpp"
  59. "src/test/Test.cpp"
  60. )
  61. add_library(core STATIC ${SRC})
  62. target_include_directories(core PUBLIC "src")
  63. target_compile_options(core PUBLIC
  64. -fdiagnostics-color=always
  65. -fno-exceptions
  66. -fno-rtti
  67. -fno-threadsafe-statics
  68. -nostdinc++
  69. -pedantic
  70. -pedantic-errors
  71. -Waligned-new=all
  72. -Wall
  73. -Walloca
  74. -Walloc-zero
  75. -Wanalyzer-too-complex
  76. -Warith-conversion
  77. -Warray-bounds=2
  78. -Warray-parameter
  79. -Wattribute-alias=2
  80. -Wbidi-chars=any
  81. -Wcast-align=strict
  82. -Wcast-qual
  83. -Wcatch-value=3
  84. -Wcomma-subscript
  85. -Wconditionally-supported
  86. -Wconversion
  87. -Wctad-maybe-unsupported
  88. -Wctor-dtor-privacy
  89. -Wdate-time
  90. -Wdeprecated-copy-dtor
  91. -Wdeprecated-enum-enum-conversion
  92. -Wdeprecated-enum-float-conversion
  93. -Wdisabled-optimization
  94. -Wdouble-promotion
  95. -Wduplicated-branches
  96. -Wduplicated-cond
  97. -Weffc++
  98. -Wenum-compare
  99. -Wenum-conversion
  100. -Werror
  101. -Wextra
  102. -Wextra-semi
  103. -Wfloat-equal
  104. -Wformat=2
  105. -Wformat-overflow=2
  106. -Wformat-signedness
  107. -Wformat-truncation=2
  108. -Wframe-larger-than=8388608
  109. -Wimplicit-fallthrough=5
  110. -Winfinite-recursion
  111. -Winit-self
  112. -Winvalid-imported-macros
  113. -Winvalid-pch
  114. -Wlarger-than=1073741824
  115. -Wlogical-op
  116. -Wmismatched-tags
  117. -Wmissing-braces
  118. -Wmissing-declarations
  119. -Wmissing-include-dirs
  120. -Wmultichar
  121. -Wmultiple-inheritance
  122. -Wnoexcept
  123. -Wnon-virtual-dtor
  124. -Wnormalized=nfkc
  125. -Wnull-dereference
  126. -Wold-style-cast
  127. -Woverlength-strings
  128. -Woverloaded-virtual
  129. -Wplacement-new=2
  130. -Wredundant-decls
  131. -Wredundant-tags
  132. -Wregister
  133. -Wshadow
  134. -Wshift-overflow=2
  135. -Wsign-conversion
  136. -Wsign-promo
  137. -Wstack-protector
  138. -Wstack-usage=8388608
  139. -Wstrict-null-sentinel
  140. -Wstrict-overflow=5
  141. -Wstringop-overflow=4
  142. -Wsuggest-final-methods
  143. -Wsuggest-final-types
  144. -Wsuggest-override
  145. -Wswitch-enum
  146. -Wsynth
  147. -Wtrampolines
  148. -Wtrivial-auto-var-init
  149. -Wundef
  150. -Wunreachable-code
  151. -Wunused-const-variable=2
  152. -Wunused-macros
  153. -Wuse-after-free=3
  154. -Wvirtual-inheritance
  155. -Wvla
  156. -Wvolatile
  157. -Wwrite-strings
  158. -Wzero-as-null-pointer-constant
  159. )
  160. target_compile_definitions(core PUBLIC CORE_LOG_LEVEL=4)
  161. target_link_libraries(core PUBLIC -nodefaultlibs c m)
  162. add_executable(test ${SRC_TESTS})
  163. target_link_libraries(test PRIVATE core)
  164. add_executable(performance ${SRC_PERFORMANCE})
  165. target_link_libraries(performance PRIVATE core)