From: Eric Hawicz Date: Sun, 30 Jul 2023 15:38:01 +0000 (-0400) Subject: Issue #808: turn off -Wshorten-64-to-32 for clang builds (aka iOS builds) to workarou... X-Git-Tag: json-c-0.17-20230812~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c8b0a90e951d2ef9f816f79725e6b54d72443fa1;p=thirdparty%2Fjson-c.git Issue #808: turn off -Wshorten-64-to-32 for clang builds (aka iOS builds) to workaround "implicit conversion loses integer precision" warnings. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index c9d27062..8d64a6bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -305,6 +305,11 @@ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL endif() add_definitions(-D_GNU_SOURCE) + + if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") + # Remove this for 1.0 when we can bump the ABI and actually fix these warnings. + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-shorten-64-to-32") + endif() elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /DEBUG") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4100")