@@ -77,7 +77,6 @@ project(
7777 LANGUAGES C
7878)
7979
80- include (CheckSourceCompiles)
8180include (CheckSourceRuns)
8281include (CheckSymbolExists)
8382include (CMakeDependentOption)
@@ -422,34 +421,6 @@ if(NOT PHP_EXT_GD_EXTERNAL)
422421 set (JISX0208 TRUE )
423422 set (USE_GD_JISX0208 TRUE )
424423 endif ()
425-
426- # Do sanity check when all required packages are found.
427- block()
428- get_target_property (libraries php_ext_gd LINK_LIBRARIES )
429- set (doSanityCheck TRUE )
430- foreach (library ${libraries} )
431- if (library MATCHES "^.+::.+$" AND NOT TARGET ${library} )
432- set (doSanityCheck FALSE )
433- break ()
434- endif ()
435- endforeach ()
436-
437- if (doSanityCheck)
438- cmake_push_check_state(RESET)
439- set (CMAKE_REQUIRED_LIBRARIES ${libraries} )
440-
441- check_source_compiles(
442- C
443- [[int main(void) { return 0; }]]
444- _PHP_GD_SANITY_CHECK_COMPILES
445- )
446- cmake_pop_check_state()
447-
448- if (NOT _PHP_GD_SANITY_CHECK_COMPILES)
449- message (FATAL_ERROR "GD sanity check failed." )
450- endif ()
451- endif ()
452- endblock()
453424else ()
454425 find_package (GD 2.1.0)
455426 set_package_properties(
@@ -464,18 +435,7 @@ else()
464435 target_sources (php_ext_gd PRIVATE gd_compat.c)
465436
466437 if (TARGET GD::GD)
467- # Sanity check.
468- cmake_push_check_state(RESET)
469- set (CMAKE_REQUIRED_LIBRARIES GD::GD)
470- check_symbol_exists(gdImageCreate gd.h HAVE_LIBGD)
471- cmake_pop_check_state()
472-
473- if (NOT HAVE_LIBGD)
474- message (
475- FATAL_ERROR
476- "GD sanity check failed: 'gdImageCreate()' could not be found in libgd."
477- )
478- endif ()
438+ set (HAVE_LIBGD TRUE )
479439
480440 # Build and run a program to determine if GD has support for the given
481441 # format. The first argument is the proper-noun-capitalized name of the
0 commit comments