From: Hans Kristian Rosbach Date: Thu, 20 Jul 2023 17:43:08 +0000 (+0200) Subject: Move check_c_source_compile_or_run cmake macro to the only place it is used. X-Git-Tag: 2.1.4~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4894be9c930b3a7f61bb1309d485199d0fa47bbc;p=thirdparty%2Fzlib-ng.git Move check_c_source_compile_or_run cmake macro to the only place it is used. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fc865928..39a30ef58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -486,16 +486,6 @@ if(NOT HAVE_PTRDIFF_T) endif() endif() -# Macro to check if source compiles -# (and, when compiling very natively, also runs). -macro(check_c_source_compile_or_run source flag) - if(CMAKE_CROSSCOMPILING OR NOT WITH_NATIVE_INSTRUCTIONS) - check_c_source_compiles("${source}" ${flag}) - else() - check_c_source_runs("${source}" ${flag}) - endif() -endmacro() - add_compile_options($<$:-DZLIB_DEBUG>) if(MSVC) diff --git a/cmake/detect-intrinsics.cmake b/cmake/detect-intrinsics.cmake index f5cc06bf7..536c27fb7 100644 --- a/cmake/detect-intrinsics.cmake +++ b/cmake/detect-intrinsics.cmake @@ -1,6 +1,17 @@ # detect-intrinsics.cmake -- Detect compiler intrinsics support # Licensed under the Zlib license, see LICENSE.md for details +# Macro to check if source compiles +# (and, when compiling very natively, also runs). +macro(check_c_source_compile_or_run source flag) + if(CMAKE_CROSSCOMPILING OR NOT WITH_NATIVE_INSTRUCTIONS) + check_c_source_compiles("${source}" ${flag}) + else() + check_c_source_runs("${source}" ${flag}) + endif() +endmacro() + + macro(check_acle_compiler_flag) if(MSVC) # Both ARM and ARM64-targeting msvc support intrinsics, but