Skip to content

Instantly share code, notes, and snippets.

@abhishekgnanda
abhishekgnanda / DetectLittleEndian.txt
Last active February 24, 2017 09:40
Detect if system is little-endian in cmake
include (TestBigEndian)
TEST_BIG_ENDIAN(IS_BIG_ENDIAN)
if(IS_BIG_ENDIAN)
message(FATAL_ERROR "This is a big-endian system and is not supported")
else()
message(STATUS "Little endian system")
endif()