light/CMakeLists.txt

27 lines
1.1 KiB
Text
Raw Normal View History

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-20 14:53:58 +03:30
add_option(ENABLE_TESTS "Enables the building of the test modules")
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)
add_option(ENABLE_STATIC_ANALYSIS "Performs static analysis via clang-tidy and fails build on failing checks")
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 ()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/modules)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/glad)