From 6c1a044d429d9a9233b88b2c6965b87c370944dc Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Wed, 7 May 2025 12:18:39 -0700 Subject: [PATCH 1/2] Test whether big/little endian using newer constructs. For some reason, Windows WSL/Ubuntu didn't work with the older method (which I believe is now deprecated); use the newer 'CMAKE_C_BYTE_ORDER' instead. --- CMakeLists.txt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b8f477d..bdbf7632 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -663,12 +663,9 @@ check_include_files (stdlib.h STDC_HEADERS) check_include_files (string.h STDC_HEADERS) set(WORDS_BIGENDIAN) -if (UNIX) - include (TestBigEndian) - test_big_endian(WORDS_BIGENDIAN) +if(CMAKE_C_BYTE_ORDER STREQUAL "BIG_ENDIAN") + set(WORDS_BIGENDIAN TRUE) else() - # test_big_endian seems to fail with nmake (VS 2010) on windows - # however, windows is always little endian, so catch this here set(WORDS_BIGENDIAN FALSE) endif() From 83a8aa930092f4db5506c22514ae724dd439dc5b Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Wed, 8 Oct 2025 16:57:13 -0700 Subject: [PATCH 2/2] Updating to the latest libz made this change necessary. Still not sure why! But changing "${LIBZ_LIBRARY}" to just LIBZ_LIBRARY worked in my new dependencies environment. I believe it should still work normally, as well. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bdbf7632..14ba82ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -389,7 +389,7 @@ if(WITH_ZLIB) add_definitions( -DUSE_ZLIB ) # make sure that we have a valid zip library - check_library_exists("${LIBZ_LIBRARY}" "gzopen" "" LIBZ_FOUND_SYMBOL) + check_library_exists(LIBZ_LIBRARY "gzopen" "" LIBZ_FOUND_SYMBOL) if(NOT LIBZ_FOUND_SYMBOL) # this is odd, but on windows this check always fails! must be a # bug in the current cmake version so for now only issue this