40 lines
1.4 KiB
CMake
40 lines
1.4 KiB
CMake
cmake_minimum_required(VERSION 3.21)
|
|
project(AssignmentProject)
|
|
|
|
option(ENABLE_ADDRSAN "Enable the address sanitizer" OFF)
|
|
option(ENABLE_UBSAN "Enable the ub sanitizer" OFF)
|
|
option(ENABLE_TSAN "Enable the thread data race sanitizer" OFF)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
option(BUILD_PROFILING OFF)
|
|
option(BUILD_NBT OFF)
|
|
add_subdirectory(libraries/BLT)
|
|
|
|
include_directories(include/)
|
|
file(GLOB_RECURSE PROJECT_BUILD_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
|
|
file(GLOB_RECURSE PROJECT_C_BUILD_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.c")
|
|
|
|
add_executable(AssignmentProject ${PROJECT_BUILD_FILES} ${PROJECT_C_BUILD_FILES})
|
|
|
|
target_link_libraries(AssignmentProject BLT)
|
|
target_link_libraries(AssignmentProject stdc++fs)
|
|
|
|
target_compile_options(AssignmentProject PRIVATE -Wall -Wextra -Wpedantic -Wno-comment)
|
|
target_link_options(AssignmentProject PRIVATE -Wall -Wextra -Wpedantic -Wno-comment)
|
|
|
|
if (${ENABLE_ADDRSAN} MATCHES ON)
|
|
target_compile_options(AssignmentProject PRIVATE -fsanitize=address)
|
|
target_link_options(AssignmentProject PRIVATE -fsanitize=address)
|
|
endif ()
|
|
|
|
if (${ENABLE_UBSAN} MATCHES ON)
|
|
target_compile_options(AssignmentProject PRIVATE -fsanitize=undefined)
|
|
target_link_options(AssignmentProject PRIVATE -fsanitize=undefined)
|
|
endif ()
|
|
|
|
if (${ENABLE_TSAN} MATCHES ON)
|
|
target_compile_options(AssignmentProject PRIVATE -fsanitize=thread)
|
|
target_link_options(AssignmentProject PRIVATE -fsanitize=thread)
|
|
endif () |