forked from MaJerle/lwprintf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
43 lines (36 loc) · 1.06 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
cmake_minimum_required(VERSION 3.22)
# Setup project
project(LwLibPROJECT)
if(NOT PROJECT_IS_TOP_LEVEL)
add_subdirectory(lwprintf)
else()
# Set as executable
add_executable(${PROJECT_NAME})
# Add key executable block
target_sources(${PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_LIST_DIR}/dev/main.c
${CMAKE_CURRENT_LIST_DIR}/lwprintf/src/system/lwprintf_sys_win32.c
)
# Add key include paths
target_include_directories(${PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_LIST_DIR}/dev
)
# Compilation definition information
target_compile_definitions(${PROJECT_NAME} PUBLIC
WIN32
_DEBUG
CONSOLE
LWPRINTF_DEV
)
# Compiler options
target_compile_options(${PROJECT_NAME} PRIVATE
-Wall
-Wextra
-Wpedantic
)
# Add subdir with lwprintf and link to the project
set(LWPRINTF_OPTS_FILE ${CMAKE_CURRENT_LIST_DIR}/dev/lwprintf_opts.h)
add_subdirectory(lwprintf)
target_link_libraries(${PROJECT_NAME} lwprintf)
endif()