summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-08-22 22:54:07 +0200
committerJulian Andres Klode <jak@debian.org>2016-08-26 15:49:14 +0200
commitb10ec8cc7b6b9d181cccacee6b4c1c4c5bdbd510 (patch)
treebcdf454179ea75fafcf434abea83572212a4c3ba /CMakeLists.txt
parent0fa5d862040a56fbad9a2bd563243f23359a881d (diff)
CMake: Handle endian.h locations on other platforms
Gbp-Dch: ignore
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 27d0dd5a3..08e431740 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -118,6 +118,18 @@ if (CMAKE_USE_PTHREADS_INIT)
set(HAVE_PTHREAD 1)
endif()
+CHECK_INCLUDE_FILES(machine/endian.h HAVE_MACHINE_ENDIAN_H)
+CHECK_INCLUDE_FILES(sys/endian.h HAVE_SYS_ENDIAN_H)
+CHECK_INCLUDE_FILES(endian.h HAVE_ENDIAN_H)
+if (NOT HAVE_ENDIAN_H)
+ if (HAVE_MACHINE_ENDIAN_H OR HAVE_SYS_ENDIAN_H)
+ configure_file(CMake/endian.h.in ${PROJECT_BINARY_DIR}/include/endian.h)
+ else()
+ message(FATAL_ERROR "Cannot find endian.h")
+ endif()
+endif()
+
+
include(CheckTypeSize)
set(CMAKE_EXTRA_INCLUDE_FILES "signal.h")
check_type_size("sig_t" SIG_T LANGUAGE "CXX")