-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCMakeLists.txt
44 lines (35 loc) · 1.1 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
cmake_minimum_required(VERSION 3.10)
include(../version.cmake)
project(tracepoint-control-cpp
VERSION ${LINUXTRACEPOINTS_VERSION}
DESCRIPTION "Linux tracepoint collection for C++"
HOMEPAGE_URL "https://github.com/microsoft/LinuxTracepoints"
LANGUAGES CXX)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
set(CMAKE_CXX_STANDARD 98) # Ensure projects declare minimum C++ requirement.
set(BUILD_SAMPLES ON CACHE BOOL "Build sample code")
set(BUILD_TOOLS ON CACHE BOOL "Build tool code")
if(NOT WIN32)
if(NOT TARGET tracepoint-decode)
find_package(tracepoint-decode ${TRACEPOINT_DECODE_MINVER} REQUIRED)
endif()
add_compile_options(
-Wall
-Wextra
-Wformat
-Wformat-security
-Werror=format-security
-Wstack-protector
-Werror=stack-protector)
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_options(-D_FORTIFY_SOURCE=2)
endif()
add_subdirectory(src)
if(BUILD_SAMPLES)
add_subdirectory(samples)
endif()
if(BUILD_TOOLS)
add_subdirectory(tools)
endif()
endif()