Skip to content

Commit 1c43c72

Browse files
committed
Merge branch 'PHP-8.4'
2 parents 33c044f + 0580e13 commit 1c43c72

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

cmake/cmake/modules/PHP/SearchLibraries.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ The arguments are:
6969
a macro definition. It would not be found using the other two commands because
7070
they don't include required headers.
7171
72+
Any `-l` strings prepended to the provided libraries are removed in the
73+
results. For example, `-ldl` will be interpreted as `dl`.
74+
7275
* `VARIABLE <variable>`
7376
7477
Optional. Name of an internal cache variable where the result of the check is
@@ -274,6 +277,9 @@ function(php_search_libraries)
274277
foreach(library IN LISTS parsed_LIBRARIES)
275278
unset(${parsed_VARIABLE} CACHE)
276279

280+
# If library was given as -l<library-name>, remove the linker flag.
281+
string(REGEX REPLACE "^-l" "" library "${library}")
282+
277283
if(NOT CMAKE_REQUIRED_QUIET)
278284
message(CHECK_START "Looking for ${symbol} in ${library}")
279285
endif()

docs/cmake/modules/PHP/SearchLibraries.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ The arguments are:
7171
a macro definition. It would not be found using the other two commands because
7272
they don't include required headers.
7373

74+
Any `-l` strings prepended to the provided libraries are removed in the
75+
results. For example, `-ldl` will be interpreted as `dl`.
76+
7477
* `VARIABLE <variable>`
7578

7679
Optional. Name of an internal cache variable where the result of the check is

0 commit comments

Comments
 (0)