@@ -77,7 +77,6 @@ project(
7777 LANGUAGES C
7878)
7979
80- include (CheckSourceCompiles)
8180include (CheckSourceRuns)
8281include (CheckSymbolExists)
8382include (CMakeDependentOption)
@@ -412,34 +411,6 @@ if(NOT PHP_EXT_GD_EXTERNAL)
412411 set (JISX0208 TRUE )
413412 set (USE_GD_JISX0208 TRUE )
414413 endif ()
415-
416- # Do sanity check when all required packages are found.
417- block()
418- get_target_property (libraries php_ext_gd LINK_LIBRARIES )
419- set (doSanityCheck TRUE )
420- foreach (library ${libraries} )
421- if (library MATCHES "^.+::.+$" AND NOT TARGET ${library} )
422- set (doSanityCheck FALSE )
423- break ()
424- endif ()
425- endforeach ()
426-
427- if (doSanityCheck)
428- cmake_push_check_state(RESET)
429- set (CMAKE_REQUIRED_LIBRARIES ${libraries} )
430-
431- check_source_compiles(
432- C
433- [[int main(void) { return 0; }]]
434- _PHP_GD_SANITY_CHECK_COMPILES
435- )
436- cmake_pop_check_state()
437-
438- if (NOT _PHP_GD_SANITY_CHECK_COMPILES)
439- message (FATAL_ERROR "GD sanity check failed." )
440- endif ()
441- endif ()
442- endblock()
443414else ()
444415 find_package (GD 2.1.0)
445416 set_package_properties(
@@ -454,18 +425,7 @@ else()
454425 target_sources (php_ext_gd PRIVATE gd_compat.c)
455426
456427 if (TARGET GD::GD)
457- # Sanity check.
458- cmake_push_check_state(RESET)
459- set (CMAKE_REQUIRED_LIBRARIES GD::GD)
460- check_symbol_exists(gdImageCreate gd.h HAVE_LIBGD)
461- cmake_pop_check_state()
462-
463- if (NOT HAVE_LIBGD)
464- message (
465- FATAL_ERROR
466- "GD sanity check failed: 'gdImageCreate()' could not be found in libgd."
467- )
468- endif ()
428+ set (HAVE_LIBGD TRUE )
469429
470430 # Build and run a program to determine if GD has support for the given
471431 # format. The first argument is the proper-noun-capitalized name of the
0 commit comments