-
Notifications
You must be signed in to change notification settings - Fork 191
/
CMakeLists.txt
41 lines (35 loc) · 1.16 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
cmake_minimum_required(VERSION 3.0)
project (SwitchLanPlay)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
set(CMAKE_C_FLAGS_DEBUG
"-g3 -ggdb -g"
)
endif()
include(TestBigEndian)
test_big_endian(BIG_ENDIAN)
if (BIG_ENDIAN)
add_definitions(-DLANPLAY_BIG_ENDIAN)
else ()
add_definitions(-DLANPLAY_LITTLE_ENDIAN)
endif ()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
add_definitions(-DLANPLAY_LINUX)
# How to detect android or termux in cmake? https://github.com/termux/termux-packages/issues/151
EXECUTE_PROCESS(COMMAND uname -o COMMAND tr -d '\n' OUTPUT_VARIABLE OPERATING_SYSTEM)
if(${OPERATING_SYSTEM} MATCHES "Android")
set(OS_ANDROID 1)
endif(${OPERATING_SYSTEM} MATCHES "Android")
elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
add_definitions(-DLANPLAY_FREEBSD)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
add_definitions(-DLANPLAY_DARWIN)
endif()
# add external libraries
include(external/external.cmake)
add_subdirectory(base)
add_subdirectory(lwip)
add_subdirectory(uv_lwip)
add_subdirectory(src)