Skip to content

Instantly share code, notes, and snippets.

@abhishekgnanda
Last active February 24, 2017 09:40
Show Gist options
  • Save abhishekgnanda/4928d4986a7bdc9b6f1a7a7a08702708 to your computer and use it in GitHub Desktop.
Save abhishekgnanda/4928d4986a7bdc9b6f1a7a7a08702708 to your computer and use it in GitHub Desktop.
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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment