ansilove

ANSI and ASCII art to PNG converter in C
Log | Files | Refs | README | LICENSE

commit 5d26d38e61ae9469e796a1b244fad412f72f158c
parent 2ab422a54b2156f7a6cc2e8ed0e8969ee014644e
Author: Frederic Cambus <fred@statdns.com>
Date:   Tue, 19 Nov 2019 10:46:30 +0100

Add ENABLE_SECCOMP build option, to allow building seccomp support conditionally.

Diffstat:
MCMakeLists.txt | 24+++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt @@ -5,20 +5,26 @@ project (ansilove C) include(CheckFunctionExists) include(GNUInstallDirs) +# Conditional build options +set(ENABLE_SECCOMP 1 + CACHE BOOL "Enable building with seccomp") + # Check if system has pledge and strtonum list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_OPENBSD_SOURCE) check_function_exists(pledge HAVE_PLEDGE) check_function_exists(strtonum HAVE_STRTONUM) -# 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() +if(ENABLE_SECCOMP) + # 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() +endif(ENABLE_SECCOMP) # Additional include directories for compat functions include_directories("compat")