123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- cmake_minimum_required(VERSION 3.25)
- project(core)
- set(CMAKE_CXX_STANDARD 20)
- set(SRC
- "src/utils/Logger.cpp"
- "src/utils/Utility.cpp"
- "src/utils/Error.cpp"
- "src/utils/New.cpp"
- "src/utils/Buffer.cpp"
- "src/utils/Clock.cpp"
- "src/utils/Random.cpp"
- "src/data/BitArray.cpp"
- "src/math/Math.cpp"
- "src/math/Vector.cpp"
- "src/math/Quaternion.cpp"
- "src/math/Matrix.cpp"
- "src/math/Box.cpp"
- "src/math/Plane.cpp"
- "src/math/Frustum.cpp"
- "src/math/View.cpp"
- "src/thread/Thread.cpp"
- "src/io/FileReader.cpp"
- )
- set(SRC_TESTS
- "src/test/Main.cpp"
- "src/test/Test.cpp"
- "src/tests/ArrayTests.cpp"
- "src/tests/ArrayStringTests.cpp"
- "src/tests/UtilityTests.cpp"
- "src/tests/ArrayListTests.cpp"
- "src/tests/BitArrayTests.cpp"
- "src/tests/MathTests.cpp"
- "src/tests/ListTests.cpp"
- "src/tests/LinkedListTests.cpp"
- "src/tests/UniquePointerTests.cpp"
- "src/tests/HashMapTests.cpp"
- "src/tests/ProbingHashMapTests.cpp"
- "src/tests/StackTests.cpp"
- "src/tests/RingBufferTests.cpp"
- "src/tests/ComponentsTests.cpp"
- "src/tests/VectorTests.cpp"
- "src/tests/QuaternionTests.cpp"
- "src/tests/MatrixTests.cpp"
- "src/tests/BoxTests.cpp"
- "src/tests/BufferedValueTests.cpp"
- "src/tests/PlaneTests.cpp"
- "src/tests/FrustumTests.cpp"
- "src/tests/ViewTests.cpp"
- "src/tests/MatrixStackTests.cpp"
- "src/tests/ColorTests.cpp"
- "src/tests/BufferTests.cpp"
- "src/tests/ClockTests.cpp"
- "src/tests/RandomTests.cpp"
- "src/tests/ThreadTests.cpp"
- "src/tests/FileReaderTests.cpp"
- )
- set(SRC_PERFORMANCE
- "src/performance/Main.cpp"
- "src/test/Test.cpp"
- )
- add_library(core STATIC ${SRC})
- target_include_directories(core PUBLIC "src")
- target_compile_options(core PUBLIC
- -fdiagnostics-color=always
- -fno-exceptions
- -fno-rtti
- -fno-threadsafe-statics
- -nostdinc++
- -pedantic
- -pedantic-errors
- -Waligned-new=all
- -Wall
- -Walloca
- -Walloc-zero
- -Wanalyzer-too-complex
- -Warith-conversion
- -Warray-bounds=2
- -Warray-parameter
- -Wattribute-alias=2
- -Wbidi-chars=any
- -Wcast-align=strict
- -Wcast-qual
- -Wcatch-value=3
- -Wcomma-subscript
- -Wconditionally-supported
- -Wconversion
- -Wctad-maybe-unsupported
- -Wctor-dtor-privacy
- -Wdate-time
- -Wdeprecated-copy-dtor
- -Wdeprecated-enum-enum-conversion
- -Wdeprecated-enum-float-conversion
- -Wdisabled-optimization
- -Wdouble-promotion
- -Wduplicated-branches
- -Wduplicated-cond
- -Weffc++
- -Wenum-compare
- -Wenum-conversion
- -Werror
- -Wextra
- -Wextra-semi
- -Wfloat-equal
- -Wformat=2
- -Wformat-overflow=2
- -Wformat-signedness
- -Wformat-truncation=2
- -Wframe-larger-than=8388608
- -Wimplicit-fallthrough=5
- -Winfinite-recursion
- -Winit-self
- -Winvalid-imported-macros
- -Winvalid-pch
- -Wlarger-than=1073741824
- -Wlogical-op
- -Wmismatched-tags
- -Wmissing-braces
- -Wmissing-declarations
- -Wmissing-include-dirs
- -Wmultichar
- -Wmultiple-inheritance
- -Wnoexcept
- -Wnon-virtual-dtor
- -Wnormalized=nfkc
- -Wnull-dereference
- -Wold-style-cast
- -Woverlength-strings
- -Woverloaded-virtual
- -Wplacement-new=2
- -Wredundant-decls
- -Wredundant-tags
- -Wregister
- -Wshadow
- -Wshift-overflow=2
- -Wsign-conversion
- -Wsign-promo
- -Wstack-protector
- -Wstack-usage=8388608
- -Wstrict-null-sentinel
- -Wstrict-overflow=5
- -Wstringop-overflow=4
- -Wsuggest-final-methods
- -Wsuggest-final-types
- -Wsuggest-override
- -Wswitch-enum
- -Wsynth
- -Wtrampolines
- -Wtrivial-auto-var-init
- -Wundef
- -Wunreachable-code
- -Wunused-const-variable=2
- -Wunused-macros
- -Wuse-after-free=3
- -Wvirtual-inheritance
- -Wvla
- -Wvolatile
- -Wwrite-strings
- -Wzero-as-null-pointer-constant
- )
- target_compile_definitions(core PUBLIC CORE_LOG_LEVEL=4)
- target_link_libraries(core PUBLIC -nodefaultlibs c m)
- add_executable(test ${SRC_TESTS})
- target_link_libraries(test PRIVATE core)
- add_executable(performance ${SRC_PERFORMANCE})
- target_link_libraries(performance PRIVATE core)
|