Skip to content

Commit

Permalink
Modifying CMakeList to link pledge conditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
fcambus committed Jan 20, 2016
1 parent ccc00c3 commit 9cc5838
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Expand Up @@ -5,8 +5,9 @@ project (ansilove C)
include(CheckFunctionExists)
include(GNUInstallDirs)

# Check if system has strtonum
# 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)

# Additional include directories for compat functions
Expand All @@ -21,6 +22,10 @@ set(SRC src/main.c src/albinfonts.c src/ansilove.c src/explode.c src/filesize.c

set(FORMATS src/ansi.c src/artworx.c src/binary.c src/icedraw.c src/pcboard.c src/tundra.c src/xbin.c)

if(NOT HAVE_PLEDGE)
set (SRC ${SRC} compat/pledge.c)
endif()

if(NOT HAVE_STRTONUM)
set (SRC ${SRC} compat/strtonum.c)
endif()
Expand Down

0 comments on commit 9cc5838

Please sign in to comment.