-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
33 lines (27 loc) · 887 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
cmake_minimum_required(VERSION 3.26)
project(2048 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
add_executable(2048
main.cpp
argumentsparser.cpp headers/argumentsparser.hpp
graphics.cpp headers/graphics.hpp
game.cpp headers/game.hpp
)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(2048 Threads::Threads)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|AppleClang|GNU")
target_compile_options(2048 PRIVATE -Wall -Wextra -Wunreachable-code -Wpedantic)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
target_compile_options(2048 PRIVATE /W4)
endif()
# Tests
add_executable(2048Tests
tests/tests.cpp
graphics.cpp headers/graphics.hpp
game.cpp headers/game.hpp
)
target_compile_definitions(2048Tests PRIVATE UNIT_TESTING)