From: evo <149657734+evo-i@users.noreply.github.com> Date: Tue, 12 Dec 2023 13:28:41 +0000 (+0300) Subject: [CMP0153](https://cmake.org/cmake/help/latest/policy/CMP0153.html) X-Git-Tag: json-c-0.18-20240915~18^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F845%2Fhead;p=thirdparty%2Fjson-c.git [CMP0153](https://cmake.org/cmake/help/latest/policy/CMP0153.html) --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ce1da94..8876500e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -177,9 +177,13 @@ endif() # uClibc *intentionally* crashes in duplocale(), at least as of: # https://github.com/ffainelli/uClibc/blob/266bdc1/libc/misc/locale/locale.c#L1322 -# So, if it looks like we're compiling for a system like that just disable +# So, if it looks like we're compiling for a system like that just disable # locale handling entirely. -exec_program(${CMAKE_C_COMPILER} ARGS -dumpmachine OUTPUT_VARIABLE CMAKE_GNU_C_MACHINE) +if (CMAKE_VERSION GREATER_EQUAL "3.28") + execute_process (COMMAND ${CMAKE_C_COMPILER} -dumpmachine OUTPUT_QUIET ERROR_QUIET OUTPUT_VARIABLE CMAKE_GNU_C_MACHINE) +else () + exec_program(${CMAKE_C_COMPILER} ARGS -dumpmachine OUTPUT_VARIABLE CMAKE_GNU_C_MACHINE) +endif () if (CMAKE_GNU_C_MACHINE MATCHES "uclibc") message(STATUS "Detected uClibc compiler, disabling locale handling") set(HAVE_SETLOCALE 0) @@ -569,4 +573,3 @@ if (NOT MSVC) # cmd line apps don't built on Windows currently. add_subdirectory(apps) endif() endif() -