@@ -57,10 +57,24 @@ target_include_directories(
5757    ${PHP_SOURCE_DIR} 
5858)
5959
60- # Interface library that ties objects and configuration together for PHP SAPIs. 
61- add_library (php_sapi INTERFACE )
62- add_library (PHP::sapi ALIAS php_sapi)
63- target_link_libraries (php_sapi INTERFACE  PHP::config)
60+ # Create PHP core library that ties objects and configuration together for PHP 
61+ # SAPIs and shared extensions. On Windows (win32 directory) there is also a 
62+ # shared DLL created for shared extensions to have symbols available. 
63+ add_library (php_core INTERFACE )
64+ add_library (PHP::core ALIAS php_core)
65+ 
66+ add_library (php_core_objects INTERFACE )
67+ add_library (PHP::core::objects ALIAS php_core_objects)
68+ target_link_libraries (
69+   php_core
70+   INTERFACE 
71+     PHP::config
72+     $<$<NOT :$<PLATFORM_ID:Windows>>:PHP::core::objects>
73+ )
74+ 
75+ target_compile_definitions (
76+   php_config INTERFACE 
77+ )
6478
6579################################################################################ 
6680# Configure project. 
@@ -78,6 +92,14 @@ define_property(
7892  BRIEF_DOCS "Whether the PHP SAPI is FastCGI-based" 
7993)
8094
95+ define_property (
96+   TARGET 
97+   PROPERTY PHP_CORE
98+   BRIEF_DOCS
99+     "Whether the target should get compile properties dedicated to PHP core " 
100+     "objects (e.g, *_EXPORTS compile definitions, etc.)." 
101+ )
102+ 
81103# Check whether IPO/LTO can be enabled. 
82104include (PHP/Optimization)
83105
@@ -124,6 +146,7 @@ include(cmake/ConfigureChecks.cmake)
124146# Check compilation options. 
125147include (cmake/Flags .cmake)
126148
149+ add_subdirectory (win32 )
127150add_subdirectory (sapi)
128151add_subdirectory (ext )
129152add_subdirectory (Zend)
@@ -135,7 +158,6 @@ message(STATUS "===============")
135158message (STATUS  "" )
136159
137160add_subdirectory (pear)
138- add_subdirectory (win32 )
139161add_subdirectory (main)
140162add_subdirectory (scripts)
141163
0 commit comments