2025-07-14 08:45:09 +00:00
|
|
|
cmake_minimum_required(VERSION 3.14)
|
2022-03-04 22:40:20 +03:30
|
|
|
project(Light)
|
2025-07-05 13:28:41 +03:30
|
|
|
set(CMAKE_CXX_STANDARD 23)
|
2025-07-05 11:33:43 +03:30
|
|
|
|
2025-07-20 14:53:58 +03:30
|
|
|
add_option(ENABLE_TESTS "Enables the building of the test modules")
|
2025-07-16 10:52:49 +03:30
|
|
|
include(${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/functions.cmake)
|
|
|
|
include(${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/definitions.cmake)
|
|
|
|
include(${CMAKE_CURRENT_SOURCE_DIR}/tools/cmake/dependencies.cmake)
|
2025-07-11 14:25:09 +03:30
|
|
|
|
2025-07-16 10:52:49 +03:30
|
|
|
add_option(ENABLE_STATIC_ANALYSIS "Performs static analysis via clang-tidy and fails build on failing checks")
|
2025-07-11 14:25:09 +03:30
|
|
|
if (ENABLE_STATIC_ANALYSIS)
|
|
|
|
set(CMAKE_CXX_CLANG_TIDY "clang-tidy;--warnings-as-errors=*;--allow-no-checks")
|
|
|
|
endif ()
|
|
|
|
|
2025-07-20 14:53:58 +03:30
|
|
|
add_option(ENABLE_LCOV "Enables the code coverage instrumentation for clang")
|
|
|
|
if(ENABLE_LCOV)
|
|
|
|
if (CMAKE_CXX_COMPILER_ID NOT STREQUAL "Clang")
|
|
|
|
message(FATAL_ERROR "ENABLE_LCOV option is only supported when compiling with clang")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
add_compile_options(-fprofile-instr-generate -fcoverage-mapping)
|
|
|
|
add_link_options(-fprofile-instr-generate -fcoverage-mapping)
|
|
|
|
endif ()
|
|
|
|
|
2025-07-20 05:20:43 +03:30
|
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/modules)
|
|
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/glad)
|