-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
26 lines (24 loc) · 895 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
cmake_minimum_required(VERSION 3.30)
project(Achi C)
set(CMAKE_C_STANDARD 23)
set(CMAKE_C_STANDARD_REQUIRED ON)
if(STATIC_PROJECT)
set(SDL_STATIC ON)
set(SDL_TEST OFF)
set(BUILD_SHARED_LIBS OFF)
add_subdirectory(vendor)
endif ()
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
add_executable(Achi-SDL main.c src/decision_tree.c src/game_board.c src/game_interface.c)
add_executable(Achi-console main-con.c src/decision_tree.c src/game_board.c src/game_interface.c)
if(STATIC_PROJECT)
target_link_libraries(Achi-SDL PRIVATE vendor)
else ()
target_link_libraries(Achi-SDL PRIVATE SDL3)
target_link_libraries(Achi-SDL PRIVATE SDL3_image)
target_link_libraries(Achi-SDL PRIVATE SDL3_ttf)
endif ()
target_include_directories(Achi-SDL PRIVATE include)
target_include_directories(Achi-console PRIVATE include)