@@ -60,10 +60,24 @@ target_include_directories(
6060 ${PHP_SOURCE_DIR}
6161)
6262
63- # Interface library that ties objects and configuration together for PHP SAPIs.
64- add_library (php_sapi INTERFACE )
65- add_library (PHP::sapi ALIAS php_sapi )
66- target_link_libraries (php_sapi INTERFACE PHP::config )
63+ # Create PHP core library that ties objects and configuration together for PHP
64+ # SAPIs and shared extensions. On Windows (win32 directory) there is also a
65+ # shared DLL created for shared extensions to have symbols available.
66+ add_library (php_core INTERFACE )
67+ add_library (PHP::core ALIAS php_core )
68+
69+ add_library (php_core_objects INTERFACE )
70+ add_library (PHP::core::objects ALIAS php_core_objects )
71+ target_link_libraries (
72+ php_core
73+ INTERFACE
74+ PHP::config
75+ $<$<NOT :$<PLATFORM_ID :Windows >>:PHP ::core ::objects >
76+ )
77+
78+ target_compile_definitions (
79+ php_config INTERFACE
80+ )
6781
6882# Interface library encapsulating the usage requirements for PHP extensions.
6983add_library (php_extension INTERFACE )
@@ -100,6 +114,14 @@ define_property(
100114 BRIEF_DOCS "Whether the PHP SAPI is FastCGI-based"
101115)
102116
117+ define_property (
118+ TARGET
119+ PROPERTY PHP_CORE
120+ BRIEF_DOCS
121+ "Whether the target should get compile properties dedicated to PHP core "
122+ "objects (e.g, *_EXPORTS compile definitions, etc.)."
123+ )
124+
103125# Check whether IPO/LTO can be enabled.
104126include (PHP/Core/Optimization )
105127
@@ -159,6 +181,7 @@ if(PHP_TESTING)
159181 php_testing_add ()
160182endif ()
161183
184+ add_subdirectory (win32 )
162185add_subdirectory (sapi )
163186add_subdirectory (ext )
164187add_subdirectory (Zend )
@@ -170,7 +193,6 @@ message(STATUS "===============")
170193message (STATUS "" )
171194
172195add_subdirectory (pear )
173- add_subdirectory (win32 )
174196add_subdirectory (main )
175197add_subdirectory (scripts )
176198
0 commit comments