-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
70 lines (60 loc) · 1.38 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
cmake_minimum_required(VERSION 3.23)
project(pokaylib LANGUAGES C)
set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "" FORCE)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_library(pokaylib STATIC)
target_sources(pokaylib
PRIVATE # .c files
src/pokaylib.c
PUBLIC # .h files
include/abilities.h
include/config.h
include/maps.h
include/moves.h
include/pokaylib.h
include/pokemons.h
)
add_executable(pokexec)
target_sources(pokexec
PRIVATE
src/main.c
)
target_link_libraries(pokexec
PRIVATE
pokaylib
)
target_include_directories(pokaylib
PUBLIC
include
)
target_compile_options(pokaylib
PUBLIC
# Warnings
-Wall
-Wextra
-Wformat=2
-Wno-unused-parameter
-Wshadow
-Wwrite-strings
-Wstrict-prototypes
-Wold-style-definition
-Wredundant-decls
-Wnested-externs
-Wmissing-include-dirs
)
if (CMAKE_BUILD_TYPE STREQUAL "Release")
target_compile_options(pokaylib
PUBLIC
-Werror
)
endif()
add_subdirectory(3rd-party/raylib)
target_link_libraries(pokaylib
PUBLIC
raylib
)
# Copy resources to build directory
add_custom_target(copy_assets
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_LIST_DIR}/assets ${CMAKE_CURRENT_BINARY_DIR}/assets
)
add_dependencies(pokexec copy_assets)