diff options
author | Julian Andres Klode <jak@debian.org> | 2016-08-22 22:45:19 +0200 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2016-08-26 15:49:14 +0200 |
commit | 0fa5d862040a56fbad9a2bd563243f23359a881d (patch) | |
tree | 5deeeb5aa01a133cf59426b8c9bd44687e69054a | |
parent | 24a59c62efafbdb8387b2d3c5616b04b9fd21306 (diff) |
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
-rw-r--r-- | CMakeLists.txt | 13 |
1 files changed, 13 insertions, 0 deletions
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 <deity@lists.debian.org>") |