CMakeLists.txt 3.8 KB

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