@@ -56,10 +56,24 @@ target_include_directories(
56
56
${PHP_SOURCE_DIR}
57
57
)
58
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)
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
+ )
63
77
64
78
################################################################################
65
79
# Configure project.
@@ -77,6 +91,14 @@ define_property(
77
91
BRIEF_DOCS "Whether the PHP SAPI is FastCGI-based"
78
92
)
79
93
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
+
80
102
# Check whether IPO/LTO can be enabled.
81
103
include (PHP/Optimization)
82
104
@@ -101,6 +123,7 @@ include(cmake/ConfigureChecks.cmake)
101
123
# Check compilation options.
102
124
include (cmake/Flags .cmake)
103
125
126
+ add_subdirectory (win32 )
104
127
add_subdirectory (sapi)
105
128
add_subdirectory (ext )
106
129
add_subdirectory (Zend)
@@ -112,7 +135,6 @@ message(STATUS "===============")
112
135
message (STATUS "" )
113
136
114
137
add_subdirectory (pear)
115
- add_subdirectory (win32 )
116
138
add_subdirectory (main)
117
139
add_subdirectory (scripts)
118
140
0 commit comments