@@ -57,34 +57,23 @@ target_include_directories(
5757)
5858
5959# Create PHP core library that ties objects and configuration together for PHP
60- # SAPIs and shared extensions. On Windows there is also a standalone shared DLL
61- # created for shared extensions which need it linked to have symbols available.
60+ # SAPIs and shared extensions. On Windows (win32 directory) there is also a
61+ # shared DLL created for shared extensions to have symbols available.
6262add_library (php_core INTERFACE )
6363add_library (PHP::core ALIAS php_core)
6464
6565add_library (php_core_objects INTERFACE )
6666add_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+ )
6773
68- if (CMAKE_SYSTEM_NAME STREQUAL "Windows" )
69- add_library (php_core_library SHARED)
70- add_library (PHP::core::library ALIAS php_core_library)
71- target_link_libraries (
72- php_core_library
73- PRIVATE
74- PHP::config
75- PHP::core::objects
76- )
77- target_compile_options (
78- php_core_library
79- PRIVATE
80- /nodefaultlib:libcmt
81- /d2:-AllowCompatibleILVersions
82- )
83-
84- target_link_libraries (php_core INTERFACE PHP::config PHP::core::library)
85- else ()
86- target_link_libraries (php_core INTERFACE PHP::config PHP::core::objects)
87- endif ()
74+ target_compile_definitions (
75+ php_config INTERFACE
76+ )
8877
8978################################################################################
9079# Configure project.
@@ -102,6 +91,14 @@ define_property(
10291 BRIEF_DOCS "Whether the PHP SAPI is FastCGI-based"
10392)
10493
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+
105102# Check whether IPO/LTO can be enabled.
106103include (PHP/Optimization)
107104
@@ -126,6 +123,7 @@ include(cmake/ConfigureChecks.cmake)
126123# Check compilation options.
127124include (cmake/Flags .cmake)
128125
126+ add_subdirectory (win32 )
129127add_subdirectory (sapi)
130128add_subdirectory (ext )
131129add_subdirectory (Zend)
@@ -137,7 +135,6 @@ message(STATUS "===============")
137135message (STATUS "" )
138136
139137add_subdirectory (pear)
140- add_subdirectory (win32 )
141138add_subdirectory (main)
142139add_subdirectory (scripts)
143140
0 commit comments