-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
38 lines (27 loc) · 1.07 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
cmake_minimum_required(VERSION 2.6)
PROJECT(tty-tetris)
OPTION(HOST_DEBUG "Log to console" OFF)
OPTION(USE_STDOUT_FOR_IO_CON "Use simplified console output functions" OFF)
OPTION(USE_SNPRINTF_FOR_IO_CON "Use stdlib snprintf instead of own version" OFF)
ADD_DEFINITIONS(-pipe --std=gnu99 -ftabstop=4 -Wno-unused-function)
ADD_DEFINITIONS(-Wall -Wmissing-declarations -Winit-self -Wswitch-enum -Wundef -Wshadow)
ADD_DEFINITIONS(-Wmissing-field-initializers -Wconversion -Wredundant-decls -Wpointer-arith)
IF(USE_STDOUT_FOR_IO_CON)
ADD_DEFINITIONS(-DUSE_STDOUT_FOR_IO_CON)
ENDIF()
IF(USE_SNPRINTF_FOR_IO_CON)
ADD_DEFINITIONS(-DUSE_SNPRINTF_FOR_IO_CON)
ENDIF()
FILE(GLOB SOURCES *.c nano/*.c)
ADD_EXECUTABLE(tty-tetris ${SOURCES})
IF(HOST_DEBUG)
ADD_DEFINITIONS(-O0 -g3)
ELSE()
ADD_DEFINITIONS(-Os -Werror -fvisibility=hidden -ffast-math -fmerge-all-constants -ffunction-sections -fdata-sections -s)
SET_TARGET_PROPERTIES(tty-tetris PROPERTIES LINK_FLAGS -Wl,--gc-sections)
ENDIF()
INSTALL(TARGETS tty-tetris
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)