Skip to content

Commit 900df93

Browse files
committed
Remove usage of BUILD_SHARED_LIBS
When building shared extensions, the CMake's BUILD_SHARED_LIBS variable is now irrelevant as shared extensions library type should be marked as MODULE. Further improvements in this context in the future commits.
1 parent 782019f commit 900df93

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+152
-156
lines changed

cmake/cmake/CMakeDefaults.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ option(
4040
)
4141
mark_as_advanced(CMAKE_MESSAGE_CONTEXT_SHOW)
4242

43-
# Whether to build all libraries as shared.
44-
option(BUILD_SHARED_LIBS "Build enabled PHP extensions as shared libraries")
45-
4643
# Treat all compile warnings as errors at the build phase, if compiler supports
4744
# such compile option, like -Werror, /WX, or similar.
4845
option(

cmake/cmake/presets/all-enabled.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"description": "PHP configuration with all PHP extensions shared and SAPIs enabled",
8989
"binaryDir": "${sourceDir}/php-build/all-enabled-shared",
9090
"cacheVariables": {
91-
"BUILD_SHARED_LIBS": true
91+
"TODO_PHP_BUILD_ALL_EXT_SHARED": true
9292
}
9393
},
9494
{

cmake/ext/bcmath/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ cmake_dependent_option(
4242
PHP_EXT_BCMATH_SHARED
4343
"Build the bcmath extension as a shared library"
4444
OFF
45-
"PHP_EXT_BCMATH;NOT BUILD_SHARED_LIBS"
45+
PHP_EXT_BCMATH
4646
OFF
4747
)
4848

@@ -53,7 +53,7 @@ endif()
5353
if(PHP_EXT_BCMATH_SHARED)
5454
add_library(php_ext_bcmath MODULE)
5555
else()
56-
add_library(php_ext_bcmath)
56+
add_library(php_ext_bcmath OBJECT)
5757
endif()
5858

5959
target_sources(

cmake/ext/bz2/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ cmake_dependent_option(
4545
PHP_EXT_BZ2_SHARED
4646
"Build the bz2 extension as a shared library"
4747
OFF
48-
"PHP_EXT_BZ2;NOT BUILD_SHARED_LIBS"
48+
PHP_EXT_BZ2
4949
OFF
5050
)
5151

@@ -56,7 +56,7 @@ endif()
5656
if(PHP_EXT_BZ2_SHARED)
5757
add_library(php_ext_bz2 MODULE)
5858
else()
59-
add_library(php_ext_bz2)
59+
add_library(php_ext_bz2 OBJECT)
6060
endif()
6161

6262
target_sources(

cmake/ext/calendar/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ cmake_dependent_option(
4242
PHP_EXT_CALENDAR_SHARED
4343
"Build the calendar extension as a shared library"
4444
OFF
45-
"PHP_EXT_CALENDAR;NOT BUILD_SHARED_LIBS"
45+
PHP_EXT_CALENDAR
4646
OFF
4747
)
4848

@@ -53,7 +53,7 @@ endif()
5353
if(PHP_EXT_CALENDAR_SHARED)
5454
add_library(php_ext_calendar MODULE)
5555
else()
56-
add_library(php_ext_calendar)
56+
add_library(php_ext_calendar OBJECT)
5757
endif()
5858

5959
target_sources(

cmake/ext/com_dotnet/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ cmake_dependent_option(
5050
PHP_EXT_COM_DOTNET_SHARED
5151
"Build the com_dotnet extension as a shared library"
5252
OFF
53-
"PHP_EXT_COM_DOTNET;NOT BUILD_SHARED_LIBS"
53+
PHP_EXT_COM_DOTNET
5454
OFF
5555
)
5656

@@ -61,7 +61,7 @@ endif()
6161
if(PHP_EXT_COM_DOTNET_SHARED)
6262
add_library(php_ext_com_dotnet MODULE)
6363
else()
64-
add_library(php_ext_com_dotnet)
64+
add_library(php_ext_com_dotnet OBJECT)
6565
endif()
6666

6767
target_sources(

cmake/ext/ctype/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ cmake_dependent_option(
4343
PHP_EXT_CTYPE_SHARED
4444
"Build the ctype extension as a shared library"
4545
OFF
46-
"PHP_EXT_CTYPE;NOT BUILD_SHARED_LIBS"
46+
PHP_EXT_CTYPE
4747
OFF
4848
)
4949

@@ -54,7 +54,7 @@ endif()
5454
if(PHP_EXT_CTYPE_SHARED)
5555
add_library(php_ext_ctype MODULE)
5656
else()
57-
add_library(php_ext_ctype)
57+
add_library(php_ext_ctype OBJECT)
5858
endif()
5959

6060
target_sources(

cmake/ext/curl/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ cmake_dependent_option(
4545
PHP_EXT_CURL_SHARED
4646
"Build the curl extension as a shared library"
4747
OFF
48-
"PHP_EXT_CURL;NOT BUILD_SHARED_LIBS"
48+
PHP_EXT_CURL
4949
OFF
5050
)
5151

@@ -56,7 +56,7 @@ endif()
5656
if(PHP_EXT_CURL_SHARED)
5757
add_library(php_ext_curl MODULE)
5858
else()
59-
add_library(php_ext_curl)
59+
add_library(php_ext_curl OBJECT)
6060
endif()
6161

6262
target_sources(

cmake/ext/dba/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ cmake_dependent_option(
123123
PHP_EXT_DBA_SHARED
124124
"Build the dba extension as a shared library"
125125
OFF
126-
[[PHP_EXT_DBA AND NOT BUILD_SHARED_LIBS]]
126+
PHP_EXT_DBA
127127
OFF
128128
)
129129

@@ -292,7 +292,7 @@ endif()
292292
if(PHP_EXT_DBA_SHARED)
293293
add_library(php_ext_dba MODULE)
294294
else()
295-
add_library(php_ext_dba)
295+
add_library(php_ext_dba OBJECT)
296296
endif()
297297

298298
target_sources(

cmake/ext/dom/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ cmake_dependent_option(
4343
PHP_EXT_DOM_SHARED
4444
"Build the dom extension as a shared library"
4545
OFF
46-
"PHP_EXT_DOM;NOT BUILD_SHARED_LIBS"
46+
PHP_EXT_DOM
4747
OFF
4848
)
4949

@@ -54,7 +54,7 @@ endif()
5454
if(PHP_EXT_DOM_SHARED)
5555
add_library(php_ext_dom MODULE)
5656
else()
57-
add_library(php_ext_dom)
57+
add_library(php_ext_dom OBJECT)
5858
endif()
5959

6060
target_sources(

0 commit comments

Comments
 (0)