2
2
#
3
3
# Copyright (C) 2023 The Falco Authors.
4
4
#
5
- # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
6
- # the License. You may obtain a copy of the License at
5
+ # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
6
+ # in compliance with the License. You may obtain a copy of the License at
7
7
#
8
8
# http://www.apache.org/licenses/LICENSE-2.0
9
9
#
10
- # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
11
- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
12
- # specific language governing permissions and limitations under the License.
10
+ # Unless required by applicable law or agreed to in writing, software distributed under the License
11
+ # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12
+ # or implied. See the License for the specific language governing permissions and limitations under
13
+ # the License.
13
14
#
14
15
15
- set (FALCOSECURITY_LIBS_CMAKE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR} /cmake/modules/falcosecurity-libs-repo" )
16
+ set (FALCOSECURITY_LIBS_CMAKE_SOURCE_DIR
17
+ "${CMAKE_CURRENT_SOURCE_DIR} /cmake/modules/falcosecurity-libs-repo"
18
+ )
16
19
set (FALCOSECURITY_LIBS_CMAKE_WORKING_DIR "${CMAKE_BINARY_DIR} /falcosecurity-libs-repo" )
17
20
18
21
file (MAKE_DIRECTORY ${FALCOSECURITY_LIBS_CMAKE_WORKING_DIR} )
19
22
20
23
# explicitly disable the bundled driver, since we pull it separately
21
- set (USE_BUNDLED_DRIVER OFF CACHE BOOL "" )
24
+ set (USE_BUNDLED_DRIVER
25
+ OFF
26
+ CACHE BOOL ""
27
+ )
22
28
23
29
if (FALCOSECURITY_LIBS_SOURCE_DIR)
24
- set (FALCOSECURITY_LIBS_VERSION "0.0.0-local" )
25
- message (STATUS "Using local version of falcosecurity/libs: '${FALCOSECURITY_LIBS_SOURCE_DIR} '" )
30
+ set (FALCOSECURITY_LIBS_VERSION "0.0.0-local" )
31
+ message (STATUS "Using local version of falcosecurity/libs: '${FALCOSECURITY_LIBS_SOURCE_DIR} '" )
26
32
else ()
27
- # FALCOSECURITY_LIBS_REPO accepts a repository name (<org name>/<repo name>) alternative to the falcosecurity/libs repository.
28
- # In case you want to test against a fork of falcosecurity/libs just pass the variable -
29
- # ie., `cmake -DFALCOSECURITY_LIBS_REPO=<your-gh-handle>/libs ..`
30
- if (NOT FALCOSECURITY_LIBS_REPO)
31
- set (FALCOSECURITY_LIBS_REPO "falcosecurity/libs" )
32
- endif ()
33
-
34
- # FALCOSECURITY_LIBS_VERSION accepts a git reference (branch name, commit hash, or tag) to the falcosecurity/libs repository.
35
- # In case you want to test against another falcosecurity/libs version (or branch, or commit) just pass the variable -
36
- # ie., `cmake -DFALCOSECURITY_LIBS_VERSION=dev ..`
37
- if (NOT FALCOSECURITY_LIBS_VERSION)
38
- set (FALCOSECURITY_LIBS_VERSION "e7bbd50cd04d83e088be675f10e638de732388da" )
39
- #set(FALCOSECURITY_LIBS_CHECKSUM "SHA256=aedc4120d335ee2ebf7f3c2e6346fc985ca09a49d14ff7c6249a033e47d160bf")
40
- endif ()
41
-
42
- # cd /path/to/build && cmake /path/to/source
43
- execute_process (COMMAND "${CMAKE_COMMAND} "
44
- -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE} "
45
- -DFALCOSECURITY_LIBS_REPO=${FALCOSECURITY_LIBS_REPO}
46
- -DFALCOSECURITY_LIBS_VERSION=${FALCOSECURITY_LIBS_VERSION}
47
- -DFALCOSECURITY_LIBS_CHECKSUM=${FALCOSECURITY_LIBS_CHECKSUM}
48
- ${FALCOSECURITY_LIBS_CMAKE_SOURCE_DIR} WORKING_DIRECTORY ${FALCOSECURITY_LIBS_CMAKE_WORKING_DIR} )
49
-
50
- # cmake --build .
51
- execute_process (COMMAND "${CMAKE_COMMAND} " --build . WORKING_DIRECTORY "${FALCOSECURITY_LIBS_CMAKE_WORKING_DIR} " )
52
- set (FALCOSECURITY_LIBS_SOURCE_DIR "${FALCOSECURITY_LIBS_CMAKE_WORKING_DIR} /falcosecurity-libs-prefix/src/falcosecurity-libs" )
33
+ # FALCOSECURITY_LIBS_REPO accepts a repository name (<org name>/<repo name>) alternative to the
34
+ # falcosecurity/libs repository. In case you want to test against a fork of falcosecurity/libs
35
+ # just pass the variable - ie., `cmake -DFALCOSECURITY_LIBS_REPO=<your-gh-handle>/libs ..`
36
+ if (NOT FALCOSECURITY_LIBS_REPO)
37
+ set (FALCOSECURITY_LIBS_REPO "falcosecurity/libs" )
38
+ endif ()
39
+
40
+ # FALCOSECURITY_LIBS_VERSION accepts a git reference (branch name, commit hash, or tag) to the
41
+ # falcosecurity/libs repository. In case you want to test against another falcosecurity/libs
42
+ # version (or branch, or commit) just pass the variable - ie., `cmake
43
+ # -DFALCOSECURITY_LIBS_VERSION=dev ..`
44
+ if (NOT FALCOSECURITY_LIBS_VERSION)
45
+ set (FALCOSECURITY_LIBS_VERSION "8baec4b102662200b3a382722f01276748125e0f" )
46
+ set (FALCOSECURITY_LIBS_CHECKSUM
47
+ "SHA256=e2750d337f7e28780bd7b4d2efa6ea7a99f43aed2815fd0f7529bfac1a10f429"
48
+ )
49
+ endif ()
50
+
51
+ # cd /path/to/build && cmake /path/to/source
52
+ execute_process (
53
+ COMMAND
54
+ "${CMAKE_COMMAND} " -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE} "
55
+ -DFALCOSECURITY_LIBS_REPO=${FALCOSECURITY_LIBS_REPO}
56
+ -DFALCOSECURITY_LIBS_VERSION=${FALCOSECURITY_LIBS_VERSION}
57
+ -DFALCOSECURITY_LIBS_CHECKSUM=${FALCOSECURITY_LIBS_CHECKSUM}
58
+ ${FALCOSECURITY_LIBS_CMAKE_SOURCE_DIR}
59
+ WORKING_DIRECTORY ${FALCOSECURITY_LIBS_CMAKE_WORKING_DIR}
60
+ )
61
+
62
+ # cmake --build .
63
+ execute_process (
64
+ COMMAND "${CMAKE_COMMAND} " --build .
65
+ WORKING_DIRECTORY "${FALCOSECURITY_LIBS_CMAKE_WORKING_DIR} "
66
+ )
67
+ set (FALCOSECURITY_LIBS_SOURCE_DIR
68
+ "${FALCOSECURITY_LIBS_CMAKE_WORKING_DIR} /falcosecurity-libs-prefix/src/falcosecurity-libs"
69
+ )
53
70
endif ()
54
71
55
72
set (LIBS_PACKAGE_NAME "falcosecurity" )
56
73
57
74
if (CMAKE_SYSTEM_NAME MATCHES "Linux" )
58
- add_definitions (-D_GNU_SOURCE)
75
+ add_definitions (-D_GNU_SOURCE)
59
76
endif ()
60
77
61
78
if (MUSL_OPTIMIZED_BUILD)
62
- add_definitions (-DMUSL_OPTIMIZED)
79
+ add_definitions (-DMUSL_OPTIMIZED)
63
80
endif ()
64
81
65
82
set (SCAP_HOST_ROOT_ENV_VAR_NAME "HOST_ROOT" )
66
83
set (SCAP_HOSTNAME_ENV_VAR "FALCO_HOSTNAME" )
67
84
set (SINSP_AGENT_CGROUP_MEM_PATH_ENV_VAR "FALCO_CGROUP_MEM_PATH" )
68
85
69
86
if (NOT LIBS_DIR)
70
- set (LIBS_DIR "${FALCOSECURITY_LIBS_SOURCE_DIR} " )
87
+ set (LIBS_DIR "${FALCOSECURITY_LIBS_SOURCE_DIR} " )
71
88
endif ()
72
89
73
90
# configure gVisor support
74
- set (BUILD_LIBSCAP_GVISOR ${BUILD_FALCO_GVISOR} CACHE BOOL "" )
91
+ set (BUILD_LIBSCAP_GVISOR
92
+ ${BUILD_FALCO_GVISOR}
93
+ CACHE BOOL ""
94
+ )
75
95
76
96
# configure modern BPF support
77
- set (BUILD_LIBSCAP_MODERN_BPF ${BUILD_FALCO_MODERN_BPF} CACHE BOOL "" )
97
+ set (BUILD_LIBSCAP_MODERN_BPF
98
+ ${BUILD_FALCO_MODERN_BPF}
99
+ CACHE BOOL ""
100
+ )
78
101
79
102
# explicitly disable the tests/examples of this dependency
80
- set (CREATE_TEST_TARGETS OFF CACHE BOOL "" )
81
- set (BUILD_LIBSCAP_EXAMPLES OFF CACHE BOOL "" )
82
-
83
- set (USE_BUNDLED_TBB ON CACHE BOOL "" )
84
- set (USE_BUNDLED_JSONCPP ON CACHE BOOL "" )
85
- set (USE_BUNDLED_VALIJSON ON CACHE BOOL "" )
86
- set (USE_BUNDLED_RE2 ON CACHE BOOL "" )
87
- set (USE_BUNDLED_UTHASH ON CACHE BOOL "" )
103
+ set (CREATE_TEST_TARGETS
104
+ OFF
105
+ CACHE BOOL ""
106
+ )
107
+ set (BUILD_LIBSCAP_EXAMPLES
108
+ OFF
109
+ CACHE BOOL ""
110
+ )
111
+
112
+ set (USE_BUNDLED_TBB
113
+ ON
114
+ CACHE BOOL ""
115
+ )
116
+ set (USE_BUNDLED_JSONCPP
117
+ ON
118
+ CACHE BOOL ""
119
+ )
120
+ set (USE_BUNDLED_VALIJSON
121
+ ON
122
+ CACHE BOOL ""
123
+ )
124
+ set (USE_BUNDLED_RE2
125
+ ON
126
+ CACHE BOOL ""
127
+ )
128
+ set (USE_BUNDLED_UTHASH
129
+ ON
130
+ CACHE BOOL ""
131
+ )
88
132
if (USE_DYNAMIC_LIBELF)
89
- set (USE_BUNDLED_LIBELF OFF CACHE BOOL "" )
90
- set (USE_SHARED_LIBELF ON CACHE BOOL "" )
133
+ set (USE_BUNDLED_LIBELF
134
+ OFF
135
+ CACHE BOOL ""
136
+ )
137
+ set (USE_SHARED_LIBELF
138
+ ON
139
+ CACHE BOOL ""
140
+ )
91
141
endif ()
92
142
93
143
list (APPEND CMAKE_MODULE_PATH "${FALCOSECURITY_LIBS_SOURCE_DIR} /cmake/modules" )
@@ -96,15 +146,18 @@ include(CheckSymbolExists)
96
146
check_symbol_exists(strlcpy "string.h" HAVE_STRLCPY)
97
147
98
148
if (HAVE_STRLCPY)
99
- message (STATUS "Existing strlcpy and strlcat found, will *not* use local definition by setting -DHAVE_STRLCPY and -DHAVE_STRLCAT." )
100
- add_definitions (-DHAVE_STRLCPY)
101
- add_definitions (-DHAVE_STRLCAT)
149
+ message (
150
+ STATUS
151
+ "Existing strlcpy and strlcat found, will *not* use local definition by setting -DHAVE_STRLCPY and -DHAVE_STRLCAT."
152
+ )
153
+ add_definitions (-DHAVE_STRLCPY)
154
+ add_definitions (-DHAVE_STRLCAT)
102
155
else ()
103
- message (STATUS "No strlcpy and strlcat found, will use local definition" )
156
+ message (STATUS "No strlcpy and strlcat found, will use local definition" )
104
157
endif ()
105
158
106
159
if (CMAKE_SYSTEM_NAME MATCHES "Linux" )
107
- include (driver)
160
+ include (driver)
108
161
endif ()
109
162
include (libscap)
110
163
include (libsinsp)
0 commit comments