@@ -42,11 +42,64 @@ endif()
4242set (CMAKE_C_STANDARD 99)
4343set (CMAKE_C_STANDARD_REQUIRED TRUE )
4444
45+ ################################################################################
46+ # Create interface targets providing usage requirements.
47+ ################################################################################
48+
49+ # Usage requirements for all PHP-related targets in the build.
50+ add_library (php_config INTERFACE )
51+ add_library (PHP::config ALIAS php_config)
52+ target_include_directories (
53+ php_config
54+ INTERFACE
55+ ${PHP_BINARY_DIR}
56+ ${PHP_SOURCE_DIR}
57+ )
58+
59+ # Interface library that ties objects and configuration together for PHP SAPIs.
60+ add_library (php_sapi INTERFACE )
61+ add_library (PHP::sapi ALIAS php_sapi)
62+ target_link_libraries (php_sapi INTERFACE PHP::config)
63+
4564################################################################################
4665# Configure project.
4766################################################################################
4867
49- include (cmake/Bootstrap.cmake)
68+ define_property (
69+ TARGET
70+ PROPERTY PHP_CLI
71+ BRIEF_DOCS "Whether the PHP SAPI or extension is CLI-based"
72+ )
73+
74+ define_property (
75+ TARGET
76+ PROPERTY PHP_SAPI_FASTCGI
77+ BRIEF_DOCS "Whether the PHP SAPI is FastCGI-based"
78+ )
79+
80+ # Check whether IPO/LTO can be enabled.
81+ include (PHP/Optimization)
82+
83+ # Set CMAKE_POSITION_INDEPENDENT_CODE.
84+ include (PHP/PositionIndependentCode)
85+
86+ # Configure build types.
87+ include (cmake/BuildTypes.cmake)
88+
89+ # Set platform-specific configuration.
90+ include (cmake/Platform.cmake)
91+
92+ # Set PHP configuration options and variables.
93+ include (cmake/Configuration .cmake)
94+
95+ # Check requirements.
96+ include (cmake/Requirements.cmake)
97+
98+ # Run PHP configuration checks.
99+ include (cmake/ConfigureChecks.cmake)
100+
101+ # Check compilation options.
102+ include (cmake/Flags .cmake)
50103
51104add_subdirectory (sapi)
52105add_subdirectory (ext )
@@ -69,9 +122,12 @@ include(PHP/Stubs)
69122# Check thread safety.
70123include (PHP/ThreadSafety)
71124
125+ ################################################################################
72126# Execute all deferred calls. Calls are additionally sorted with natural
73127# comparison method by their IDs. If call hasn't set any ID number, CMake
74128# assigns it a default value of __<number>.
129+ ################################################################################
130+
75131block()
76132 cmake_language(DEFER GET_CALL_IDS ids)
77133 list (SORT ids COMPARE NATURAL)
0 commit comments