-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
46 lines (35 loc) · 1.41 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
cmake_minimum_required(VERSION 3.7)
project(ilsimu)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
endif ()
set(CMAKE_C_FLAGS "-Wall -Wextra -Wmissing-declarations -Werror -pedantic")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++14")
if (PROFILE_GENERATE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-generate")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-generate")
endif ()
if (PROFILE_USE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-use")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-use")
endif ()
set(CMAKE_C_FLAGS_DEBUG "-ggdb3")
set(CMAKE_C_FLAGS_RELEASE "-O2 -s -flto -march=native")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -ggdb3 -flto -march=native")
set(CMAKE_C_FLAGS_MINSIZEREL "-Os -s -flto -march=native")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL}")
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
find_package(LIBAIRSPY REQUIRED)
find_package(Threads REQUIRED)
include_directories(${LIBAIRSPY_INCLUDE_DIR})
if ((NOT PROFILE_GENERATE) AND (NOT PROFILE_USE))
find_program(CCACHE_PROGRAM ccache)
if (CCACHE_PROGRAM)
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
endif ()
endif ()
add_subdirectory(rasseiver)