-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
57 lines (46 loc) · 1.79 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
48
49
50
51
52
53
54
55
56
57
project(zeptobird)
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_FLAGS "-std=c++17 -Wall -Werror -Wextra -pedantic-errors -fno-rtti -fno-exceptions -D_GLIBCXX_USE_CXX11_ABI=1")
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
endif()
include(CheckIPOSupported)
check_ipo_supported(RESULT supported OUTPUT error)
if(supported)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(WARNING "IPO is not supported: ${error}")
endif()
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Debug)
#SET(CMAKE_BUILD_TYPE Release)
ENDIF()
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/shared)
add_subdirectory(shared)
if(CMAKE_CROSSCOMPILING)
add_subdirectory(platforms/html5)
else()
enable_testing()
add_subdirectory(test)
add_subdirectory(platforms/sdl2)
endif()
# build info
SET(BUILD_INFO_BAR "====================================================================================")
SET(NOOP_STRING "")
MESSAGE(STATUS ${BUILD_INFO_BAR})
MESSAGE(STATUS "Summary of the build:")
MESSAGE(STATUS ${BUILD_INFO_BAR})
MESSAGE(STATUS "GENERATOR: ${CMAKE_GENERATOR}")
MESSAGE(STATUS "C_COMPILER: ${CMAKE_C_COMPILER} [${CMAKE_C_COMPILER_ID}-${CMAKE_C_COMPILER_VERSION}]")
MESSAGE(STATUS "CXX_COMPILER: ${CMAKE_CXX_COMPILER} [${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}]")
MESSAGE(STATUS "LINKER: ${CMAKE_LINKER}")
MESSAGE(STATUS "")
MESSAGE(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
MESSAGE(STATUS "")
MESSAGE(STATUS "Build type : ${CMAKE_BUILD_TYPE}")
MESSAGE(STATUS ${BUILD_INFO_BAR})
MESSAGE(STATUS ${NOOP_STRING})