-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
33 lines (24 loc) · 1.09 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
cmake_minimum_required(VERSION 3.26)
set(CMAKE_C_COMPILER /usr/bin/clang)
project(Neglest LANGUAGES C)
set(CMAKE_C_STANDARD 23)
if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_C_COMPILER_ID STREQUAL "GNU")
message(SEND_ERROR "GNU extensions are used")
endif()
add_compile_options("-Wall")
add_compile_options("-Wextra")
add_compile_options("-Wpedantic")
add_compile_options("-O3")
#add_link_options("-s")
add_compile_options("-Wno-gnu-auto-type")
add_compile_options("-Wno-logical-op-parentheses")
add_compile_options("-Wno-unknown-pragmas")
add_compile_options("-Wno-gnu-folding-constant")
file(GLOB PROJECT_SOURCES CONFIGURE_DEPENDS src/*.c src/*.h)
add_executable(${PROJECT_NAME} ${PROJECT_SOURCES})
set(GAME_LIB gameLib)
add_subdirectory(${GAME_LIB})
target_link_libraries(${PROJECT_NAME} SDL2 SDL2_ttf SDL2_image GL GLEW m ${PROJECT_SOURCE_DIR}/libs/cglm/bin/libcglm.so ${GAME_LIB})
target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/libs/cglm/include gameLib/include)
file(COPY shaders DESTINATION ${CMAKE_BINARY_DIR})
file(COPY res DESTINATION ${CMAKE_BINARY_DIR})