From: Ralf Habacker Date: Wed, 2 Mar 2022 10:00:06 +0000 (+0100) Subject: cmake: setup variable WORDS_BIGENDIAN correctly X-Git-Tag: dbus-1.15.0~98^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d74fee2727617778aafe42dc6ea7519876efe9a8;p=thirdparty%2Fdbus.git cmake: setup variable WORDS_BIGENDIAN correctly Since version 3.0 cmake provides the macro test_big_endian for that purpose. fixes #375 Signed-off-by: Ralf Habacker --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e1fc413c..a29bddcfa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,10 @@ include(MacrosAutotools) autoinit(configure.ac) autoversion(dbus) +# replacement for AC_C_BIGENDIAN +include (TestBigEndian) +test_big_endian(WORDS_BIGENDIAN) + if(EXISTS ${CMAKE_SOURCE_DIR}/config.h.in) autoheaderchecks(${CMAKE_SOURCE_DIR}/config.h.in ${CMAKE_SOURCE_DIR}/cmake/ConfigureChecks.cmake ${CMAKE_SOURCE_DIR}/cmake/config.h.cmake) else() diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake index 4215a9036..06bb34fd3 100644 --- a/cmake/config.h.cmake +++ b/cmake/config.h.cmake @@ -21,6 +21,9 @@ * should be placed in this file */ +/* AC_C_BIGENDIAN */ +#cmakedefine WORDS_BIGENDIAN + /* Opt-in to modern APIs and thread-safety for Solaris. In the Autotools * build system we do the equivalent of this by appending to CFLAGS * in configure.ac */