diff --git a/src/base/CMakeLists.txt b/src/base/CMakeLists.txt index 4b422f1cf..4c9056857 100644 --- a/src/base/CMakeLists.txt +++ b/src/base/CMakeLists.txt @@ -1,41 +1,18 @@ # Aseprite Base Library # Copyright (c) 2001-2016 David Capello -include(CheckCSourceCompiles) -include(CheckCXXSourceCompiles) -include(CheckCSourceRuns) +include(CheckIncludeFiles) +include(CheckFunctionExists) +include(TestBigEndian) -check_c_source_compiles(" -#include -int main() { - return 0; -} -" HAVE_STDINT_H) +check_include_files(stdint.h HAVE_STDINT_H) +check_include_files(dlfcn.h HAVE_DLFCN_H) +check_function_exists(sched_yield HAVE_SCHED_YIELD) -check_c_source_compiles(" -#include -int main() { - sched_yield(); - return 0; -} -" HAVE_SCHED_YIELD) +test_big_endian(ASEPRITE_BIG_ENDIAN) -check_c_source_compiles(" -#include -int main() { - return 0; -} -" HAVE_DLFCN_H) - -check_c_source_runs(" -int main() { - unsigned long value = 0x40302010ul; - return (((unsigned char*)&value)[0] == 0x10) ? 0: 1; -} -" ASEPRITE_LITTLE_ENDIAN) - -if(NOT ASEPRITE_LITTLE_ENDIAN) - set(ASEPRITE_BIG_ENDIAN TRUE) +if(NOT ASEPRITE_BIG_ENDIAN) + set(ASEPRITE_LITTLE_ENDIAN TRUE) endif() # Generate config.h file diff --git a/third_party/modp_b64/CMakeLists.txt b/third_party/modp_b64/CMakeLists.txt index 0af429802..e06af1d95 100644 --- a/third_party/modp_b64/CMakeLists.txt +++ b/third_party/modp_b64/CMakeLists.txt @@ -1,11 +1,8 @@ # cmake support for modp_b64 by David Capello -check_c_source_runs(" -int main() { - unsigned long value = 0x40302010ul; - return (((unsigned char*)&value)[0] != 0x10) ? 0: 1; -} -" WORDS_BIGENDIAN) +include(TestBigEndian) + +test_big_endian(WORDS_BIGENDIAN) if(WORDS_BIGENDIAN) add_definitions(-DWORDS_BIGENDIAN)