From 0fa5d862040a56fbad9a2bd563243f23359a881d Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 22 Aug 2016 22:45:19 +0200 Subject: CMake: Handle BSD platforms with sig_t instead of sighandler_t Somewhat annoying, but OK. Might want to switch to something more clever to get rid of the typedef at all. Gbp-Dch: ignore --- CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index fcb200571..27d0dd5a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,6 +118,19 @@ if (CMAKE_USE_PTHREADS_INIT) set(HAVE_PTHREAD 1) endif() +include(CheckTypeSize) +set(CMAKE_EXTRA_INCLUDE_FILES "signal.h") +check_type_size("sig_t" SIG_T LANGUAGE "CXX") +check_type_size("sighandler_t" SIGHANDLER_T LANGUAGE "CXX") +set(CMAKE_EXTRA_INCLUDE_FILES) +if (NOT HAVE_SIGHANDLER_T) + if (HAVE_SIG_T) + add_definitions(-Dsighandler_t=sig_t) + else() + message(FATAL_ERROR "Platform defines neither sig_t nor sighandler_t") + endif() +endif() + # Configure some variables like package, version and architecture. set(PACKAGE ${PROJECT_NAME}) set(PACKAGE_MAIL "APT Development Team ") -- cgit v1.2.3