@@ -48,20 +48,34 @@ endblock()
4848include (CheckIncludeFile)
4949include (CheckSourceCompiles)
5050include (CheckSymbolExists)
51+ include (CMakeDependentOption)
5152include (CMakePushCheckState)
53+ include (FeatureSummary)
5254include (PHP/AddCustomCommand)
5355
5456################################################################################
5557# Configuration.
5658################################################################################
5759
58- option (ZEND_GCC_GLOBAL_REGS "Enable GCC global register variables" ON )
59- mark_as_advanced (ZEND_GCC_GLOBAL_REGS)
60-
61- option (ZEND_FIBER_ASM "Enable the use of Boost fiber assembly files" ON )
60+ cmake_dependent_option(
61+ ZEND_FIBER_ASM
62+ "Enable the use of Boost fiber assembly files"
63+ ON
64+ [[NOT CMAKE_SYSTEM_NAME STREQUAL "Windows"]]
65+ ON
66+ )
6267mark_as_advanced (ZEND_FIBER_ASM)
6368
64- option (ZEND_SIGNALS "Enable Zend signal handling" ON )
69+ option (ZEND_GLOBAL_REGISTER_VARIABLES "Enable global register variables" ON )
70+ mark_as_advanced (ZEND_GLOBAL_REGISTER_VARIABLES)
71+
72+ cmake_dependent_option(
73+ ZEND_SIGNALS
74+ "Enable Zend signal handling"
75+ ON
76+ [[NOT CMAKE_SYSTEM_NAME STREQUAL "Windows"]]
77+ OFF
78+ )
6579mark_as_advanced (ZEND_SIGNALS)
6680
6781################################################################################
@@ -393,13 +407,23 @@ endif()
393407# Check Zend signals.
394408message (CHECK_START "Checking whether to enable Zend signal handling" )
395409check_symbol_exists(sigaction "signal.h" HAVE_SIGACTION)
396- if (NOT HAVE_SIGACTION OR NOT ZEND_SIGNALS)
397- message (CHECK_FAIL "no" )
398- set_property (CACHE ZEND_SIGNALS PROPERTY VALUE 0)
399- else ()
410+ if (HAVE_SIGACTION AND ZEND_SIGNALS)
400411 message (CHECK_PASS "yes" )
401- set_property (CACHE ZEND_SIGNALS PROPERTY VALUE 1)
412+
413+ set_property (CACHE ZEND_SIGNALS PROPERTY VALUE ON )
414+
415+ # zend_config.h (or its parent php_config.h) isn't included in some zend_*
416+ # files, therefore also compilation definitions are added.
417+ target_compile_definitions (zend PRIVATE ZEND_SIGNALS)
418+ else ()
419+ set_property (CACHE ZEND_SIGNALS PROPERTY VALUE OFF )
420+ message (CHECK_FAIL "no" )
402421endif ()
422+ add_feature_info(
423+ "Zend signals"
424+ ZEND_SIGNALS
425+ "signals handling within the Zend Engine for performance"
426+ )
403427
404428# Check Zend max execution timers.
405429include (Zend/MaxExecutionTimers)
@@ -414,8 +438,8 @@ include(Zend/CheckDlsym)
414438include (Zend/CheckMMAlignment)
415439
416440# Check for global register variables.
417- if (ZEND_GCC_GLOBAL_REGS )
418- include (Zend/CheckGlobalRegisterVars )
441+ if (ZEND_GLOBAL_REGISTER_VARIABLES )
442+ include (Zend/CheckGlobalRegisterVariables )
419443endif ()
420444
421445# Check if stack grows downward.
@@ -424,12 +448,6 @@ include(Zend/CheckStackLimit)
424448# Check float precision.
425449include (Zend/CheckFloatPrecision)
426450
427- # zend_config.h (or its parent php_config.h) isn't included in some zend_*
428- # files, therefore also compilation definitions need to be added.
429- if (ZEND_SIGNALS)
430- target_compile_definitions (zend PRIVATE ZEND_SIGNALS)
431- endif ()
432-
433451################################################################################
434452# Generate lexers and parsers.
435453################################################################################
0 commit comments