summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDonovan Baarda <abo@minkirri.apana.org.au>2019-09-17 17:39:03 +1000
committerGitHub <noreply@github.com>2019-09-17 17:39:03 +1000
commit52b4af48144e6b9784e3cd95aa08fb25a048648c (patch)
treec09c92cc9e9433495d65cbd84d8b48c0c6d4038d /CMakeLists.txt
parentd723fd19f399789bc2f819ee74bd90d7f9cd5360 (diff)
downloadlibrsync-52b4af48144e6b9784e3cd95aa08fb25a048648c.tar.gz
Simplify HAVE_PRINTF_Z logic using elseif clause.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 8 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 333f9cc..4e32bb9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -113,16 +113,14 @@ if(WIN32)
# CheckCSourceRuns checking for "%zu" succeeds but still gives warnings on win32.
set(HAVE_PRINTF_Z OFF)
message (STATUS "Compiling to Win32 - printf \"%zu\" size_t formatting support disabled")
-else(WIN32)
- if(CMAKE_CROSSCOMPILING)
- # CheckCSourceRuns doesn't work when cross-compiling.
- set(HAVE_PRINTF_Z ON)
- message (STATUS "Cross compiling - assuming printf \"%zu\" size_t formatting support")
- else(CMAKE_CROSSCOMPILING)
- include(CheckCSourceRuns)
- check_c_source_runs("#include <stdio.h>\nint main(){char o[8];sprintf(o, \"%zu\", (size_t)7);return o[0] != '7';}" HAVE_PRINTF_Z)
- endif(CMAKE_CROSSCOMPILING)
-endif(WIN32)
+elseif(CMAKE_CROSSCOMPILING)
+ # CheckCSourceRuns doesn't work when cross-compiling.
+ set(HAVE_PRINTF_Z ON)
+ message (STATUS "Cross compiling - assuming printf \"%zu\" size_t formatting support")
+else()
+ include(CheckCSourceRuns)
+ check_c_source_runs("#include <stdio.h>\nint main(){char o[8];sprintf(o, \"%zu\", (size_t)7);return o[0] != '7';}" HAVE_PRINTF_Z)
+endif()
include (TestBigEndian)
TEST_BIG_ENDIAN(WORDS_BIGENDIAN)