Skip to content

Commit 0bbd78d

Browse files
Leonardo Alminanaedsiper
authored andcommitted
build: added cpu byte order detection (same as msgpack-c)
Signed-off-by: Leonardo Alminana <[email protected]>
1 parent 839c963 commit 0bbd78d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ elseif(FLB_SYSTEM_FREEBSD)
8888
set(WAMR_DISABLE_STACK_HW_BOUND_CHECK 1)
8989
endif()
9090

91+
INCLUDE(TestBigEndian)
9192
include(GNUInstallDirs)
9293
include(ExternalProject)
9394
include(cmake/FindJournald.cmake)
@@ -772,6 +773,15 @@ if(FLB_HAVE_UNIX_SOCKET)
772773
FLB_DEFINITION(FLB_HAVE_UNIX_SOCKET)
773774
endif()
774775

776+
# byte order detection
777+
test_big_endian(BIG_ENDIAN_SYSTEM_DETECTED)
778+
779+
if (BIG_ENDIAN_SYSTEM_DETECTED)
780+
FLB_DEFINITION(FLB_HAVE_BIG_ENDIAN_SYSTEM)
781+
else()
782+
FLB_DEFINITION(FLB_HAVE_LITTLE_ENDIAN_SYSTEM)
783+
endif ()
784+
775785
# Configuration file YAML format support
776786
if(FLB_CONFIG_YAML)
777787
find_package(PkgConfig)

0 commit comments

Comments
 (0)