@@ -56,10 +56,24 @@ target_include_directories(
5656 ${PHP_SOURCE_DIR}
5757)
5858
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)
59+ # Create PHP core library that ties objects and configuration together for PHP
60+ # SAPIs and shared extensions. On Windows (win32 directory) there is also a
61+ # shared DLL created for shared extensions to have symbols available.
62+ add_library (php_core INTERFACE )
63+ add_library (PHP::core ALIAS php_core)
64+
65+ add_library (php_core_objects INTERFACE )
66+ add_library (PHP::core::objects ALIAS php_core_objects)
67+ target_link_libraries (
68+ php_core
69+ INTERFACE
70+ PHP::config
71+ $<$<NOT :$<PLATFORM_ID:Windows>>:PHP::core::objects>
72+ )
73+
74+ target_compile_definitions (
75+ php_config INTERFACE
76+ )
6377
6478################################################################################
6579# Configure project.
@@ -77,6 +91,14 @@ define_property(
7791 BRIEF_DOCS "Whether the PHP SAPI is FastCGI-based"
7892)
7993
94+ define_property (
95+ TARGET
96+ PROPERTY PHP_CORE
97+ BRIEF_DOCS
98+ "Whether the target should get compile properties dedicated to PHP core "
99+ "objects (e.g, *_EXPORTS compile definitions, etc.)."
100+ )
101+
80102# Check whether IPO/LTO can be enabled.
81103include (PHP/Optimization)
82104
@@ -101,6 +123,7 @@ include(cmake/ConfigureChecks.cmake)
101123# Check compilation options.
102124include (cmake/Flags .cmake)
103125
126+ add_subdirectory (win32 )
104127add_subdirectory (sapi)
105128add_subdirectory (ext )
106129add_subdirectory (Zend)
@@ -112,7 +135,6 @@ message(STATUS "===============")
112135message (STATUS "" )
113136
114137add_subdirectory (pear)
115- add_subdirectory (win32 )
116138add_subdirectory (main)
117139add_subdirectory (scripts)
118140
0 commit comments