-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
47 lines (39 loc) · 1.24 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
include(FetchContent)
### Nuklear single header library
FetchContent_Declare(
nuklear
GIT_REPOSITORY https://github.com/Immediate-Mode-UI/Nuklear.git
GIT_TAG master
GIT_SHALLOW ON
)
FetchContent_GetProperties(nuklear)
if(NOT nuklear_POPULATED)
FetchContent_Populate(nuklear)
add_library(nuklear INTERFACE ${nuklear_SOURCE_DIR}/nuklear.h)
target_compile_features(nuklear INTERFACE c_std_90)
target_include_directories(nuklear INTERFACE ${nuklear_SOURCE_DIR})
endif()
### stb single header library
FetchContent_Declare(
stb
GIT_REPOSITORY https://github.com/nothings/stb
GIT_TAG master
GIT_SHALLOW ON
)
FetchContent_GetProperties(stb)
if(NOT stb_POPULATED)
FetchContent_Populate(stb)
add_library(stb INTERFACE
${stb_SOURCE_DIR}/stb_ds.h
${stb_SOURCE_DIR}/stb_image.h
)
target_compile_features(stb INTERFACE c_std_90)
target_include_directories(stb INTERFACE ${stb_SOURCE_DIR})
endif()
### the "compile all SHLs" static library
add_library(shl STATIC shl.c)
target_compile_features(shl PRIVATE c_std_90)
if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
target_compile_options(shl PRIVATE -pedantic -Wall -Wextra -Wno-unused-function)
endif()
target_link_libraries(shl PUBLIC nuklear stb)