mirror of
https://github.com/usatiuk/psil.git
synced 2025-10-28 18:57:48 +01:00
init
This commit is contained in:
27
CMakeLists.txt
Normal file
27
CMakeLists.txt
Normal file
@@ -0,0 +1,27 @@
|
||||
cmake_minimum_required(VERSION 3.27)
|
||||
project(psil)
|
||||
|
||||
if (SANITIZE STREQUAL "YES")
|
||||
message(WARNING "Enabling sanitizers!")
|
||||
add_compile_options(-Wall -Wextra -pedantic -Wshadow -Wformat=2 -Wfloat-equal -D_GLIBCXX_DEBUG -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2)
|
||||
add_compile_options(-fsanitize=address -fsanitize=undefined -fno-sanitize-recover)
|
||||
add_link_options(-fsanitize=address -fsanitize=undefined -fno-sanitize-recover)
|
||||
endif ()
|
||||
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
add_compile_options(-flto)
|
||||
add_link_options(-flto)
|
||||
endif ()
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
add_compile_options(-O3)
|
||||
add_link_options(-O3)
|
||||
endif ()
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
enable_testing()
|
||||
|
||||
add_subdirectory(test)
|
||||
Reference in New Issue
Block a user