@@ -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################################################################################
@@ -412,13 +426,23 @@ endif()
412426# Check Zend signals.
413427message (CHECK_START "Checking whether to enable Zend signal handling" )
414428check_symbol_exists(sigaction "signal.h" HAVE_SIGACTION)
415- if (NOT HAVE_SIGACTION OR NOT ZEND_SIGNALS)
416- message (CHECK_FAIL "no" )
417- set_property (CACHE ZEND_SIGNALS PROPERTY VALUE 0)
418- else ()
429+ if (HAVE_SIGACTION AND ZEND_SIGNALS)
419430 message (CHECK_PASS "yes" )
420- set_property (CACHE ZEND_SIGNALS PROPERTY VALUE 1)
431+
432+ set_property (CACHE ZEND_SIGNALS PROPERTY VALUE ON )
433+
434+ # zend_config.h (or its parent php_config.h) isn't included in some zend_*
435+ # files, therefore also compilation definitions are added.
436+ target_compile_definitions (zend PRIVATE ZEND_SIGNALS)
437+ else ()
438+ set_property (CACHE ZEND_SIGNALS PROPERTY VALUE OFF )
439+ message (CHECK_FAIL "no" )
421440endif ()
441+ add_feature_info(
442+ "Zend signals"
443+ ZEND_SIGNALS
444+ "signals handling within the Zend Engine for performance"
445+ )
422446
423447# Check Zend max execution timers.
424448include (Zend/MaxExecutionTimers)
@@ -430,8 +454,8 @@ endif()
430454include (Zend/CheckMMAlignment)
431455
432456# Check for global register variables.
433- if (ZEND_GCC_GLOBAL_REGS )
434- include (Zend/CheckGlobalRegisterVars )
457+ if (ZEND_GLOBAL_REGISTER_VARIABLES )
458+ include (Zend/CheckGlobalRegisterVariables )
435459endif ()
436460
437461# Check if stack grows downward.
@@ -440,12 +464,6 @@ include(Zend/CheckStackLimit)
440464# Check float precision.
441465include (Zend/CheckFloatPrecision)
442466
443- # zend_config.h (or its parent php_config.h) isn't included in some zend_*
444- # files, therefore also compilation definitions need to be added.
445- if (ZEND_SIGNALS)
446- target_compile_definitions (zend PRIVATE ZEND_SIGNALS)
447- endif ()
448-
449467################################################################################
450468# Generate lexers and parsers.
451469################################################################################
0 commit comments