commit 48c1a97bcf919115a55d4258ee075cdf3216dc5d
parent ef2d1f85c9890f7a0d91d97e5317934831d09f6f
Author: Frederic Cambus <fred@statdns.com>
Date: Fri, 25 Oct 2019 19:26:34 +0200
Check if system has seccomp in CMakeLists.txt.
Diffstat:
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
@@ -4,7 +4,7 @@
# https://www.statdns.com
#
# Created: 2012-02-13
-# Last Updated: 2019-01-20
+# Last Updated: 2019-10-25
#
# StatZone is released under the BSD 2-Clause license
# See LICENSE file for details.
@@ -21,6 +21,16 @@ include(GNUInstallDirs)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_OPENBSD_SOURCE)
check_function_exists(pledge HAVE_PLEDGE)
+# Check if system has seccomp
+message(STATUS "Looking for seccomp")
+find_path(SECCOMP NAMES "linux/seccomp.h")
+if(SECCOMP)
+ message(STATUS "Looking for seccomp - found")
+ add_definitions(-DHAVE_SECCOMP=1)
+else()
+ message(STATUS "Looking for seccomp - not found")
+endif()
+
# Additional include directories for compat functions
include_directories("compat")