]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Move check_c_source_compile_or_run cmake macro to the only place it is used.
authorHans Kristian Rosbach <hk-git@circlestorm.org>
Thu, 20 Jul 2023 17:43:08 +0000 (19:43 +0200)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sun, 6 Aug 2023 08:17:24 +0000 (10:17 +0200)
CMakeLists.txt
cmake/detect-intrinsics.cmake

index 9fc865928e6bb6d8a1def08ba149e689e981cb35..39a30ef585c80335cc6d7b9460354bf9da5184e8 100644 (file)
@@ -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($<$<CONFIG:Debug>:-DZLIB_DEBUG>)
 
 if(MSVC)
index f5cc06bf772a652a1d68edebf1f03a5c314cc7c4..536c27fb722a3ba9432cb0d635d009af5a41e3b0 100644 (file)
@@ -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