mirror of
https://github.com/usatiuk/cardboy.git
synced 2025-10-28 23:27:49 +01:00
43 lines
1.3 KiB
CMake
43 lines
1.3 KiB
CMake
cmake_minimum_required(VERSION 3.10)
|
|
|
|
include(FetchContent)
|
|
FetchContent_Declare(SFML
|
|
GIT_REPOSITORY https://github.com/SFML/SFML.git
|
|
GIT_TAG 3.0.1
|
|
GIT_SHALLOW ON
|
|
EXCLUDE_FROM_ALL
|
|
SYSTEM)
|
|
FetchContent_MakeAvailable(SFML)
|
|
|
|
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
# if (NOT DEFINED SANITIZE)
|
|
# set(SANITIZE YES)
|
|
# endif ()
|
|
endif ()
|
|
|
|
if (SANITIZE STREQUAL "YES")
|
|
message(STATUS "Enabling sanitizers!")
|
|
add_compile_options(-Werror -O0 -Wall -Wextra -pedantic -Wno-unused-parameter -Wno-unused-variable
|
|
-Wno-error=unused-function
|
|
-Wshadow -Wformat=2 -Wfloat-equal -D_GLIBCXX_DEBUG -Wconversion)
|
|
add_compile_options(-fsanitize=address -fno-sanitize-recover)
|
|
add_link_options(-fsanitize=address -fno-sanitize-recover)
|
|
endif ()
|
|
|
|
if (CMAKE_BUILD_TYPE STREQUAL "Release")
|
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
|
endif ()
|
|
|
|
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
add_compile_options(-O3)
|
|
add_link_options(-O3)
|
|
endif ()
|
|
|
|
add_executable(main src/main.cpp
|
|
src/SfmlWindow.cpp
|
|
include_public/SfmlWindow.hpp)
|
|
|
|
target_include_directories(main PRIVATE include)
|
|
target_include_directories(main PUBLIC include_public)
|
|
target_link_libraries(main PRIVATE SFML::Graphics)
|
|
target_link_libraries(main PUBLIC cbsdk) |