mirror of
https://github.com/3proxy/3proxy.git
synced 2026-05-01 16:30:11 +08:00
Update CMakeLists.txt
Some checks are pending
C/C++ CI cmake / ${{ matrix.target }} (macos-15) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (windows-2022) (push) Waiting to run
Some checks are pending
C/C++ CI cmake / ${{ matrix.target }} (macos-15) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
C/C++ CI cmake / ${{ matrix.target }} (windows-2022) (push) Waiting to run
This commit is contained in:
parent
ac20f189c8
commit
9f477e2fb2
@ -440,20 +440,21 @@ if(OpenSSL_FOUND)
|
|||||||
target_link_libraries(3proxy PRIVATE OpenSSL::SSL OpenSSL::Crypto)
|
target_link_libraries(3proxy PRIVATE OpenSSL::SSL OpenSSL::Crypto)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# PCRE2 linking (static on Linux/FreeBSD, dynamic on other platforms)
|
# PCRE2 linking (try static first on Linux/FreeBSD, fallback to dynamic)
|
||||||
if(PCRE2_FOUND)
|
if(PCRE2_FOUND)
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
|
||||||
CMAKE_SYSTEM_NAME MATCHES "FreeBSD|OpenBSD|NetBSD" OR
|
CMAKE_SYSTEM_NAME MATCHES "FreeBSD|OpenBSD|NetBSD" OR
|
||||||
CMAKE_SYSTEM_NAME STREQUAL "Unix")
|
CMAKE_SYSTEM_NAME STREQUAL "Unix")
|
||||||
# Static linking for Linux/BSD
|
# Try static linking for Linux/BSD
|
||||||
find_library(PCRE2_STATIC_LIB
|
find_library(PCRE2_STATIC_LIB
|
||||||
NAMES pcre2-8 libpcre2-8.a pcre2-8.a
|
NAMES pcre2-8-static libpcre2-8.a pcre2-8.a
|
||||||
PATHS ${PC_PCRE2_LIBRARY_DIRS}
|
PATHS ${PC_PCRE2_LIBRARY_DIRS}
|
||||||
|
/usr/lib/x86_64-linux-gnu
|
||||||
/usr/lib
|
/usr/lib
|
||||||
/usr/local/lib
|
/usr/local/lib
|
||||||
/lib
|
/lib
|
||||||
)
|
)
|
||||||
if(PCRE2_STATIC_LIB)
|
if(PCRE2_STATIC_LIB AND PCRE2_STATIC_LIB MATCHES "\\.a$")
|
||||||
target_link_libraries(3proxy PRIVATE
|
target_link_libraries(3proxy PRIVATE
|
||||||
-Wl,-Bstatic
|
-Wl,-Bstatic
|
||||||
${PCRE2_STATIC_LIB}
|
${PCRE2_STATIC_LIB}
|
||||||
@ -462,8 +463,10 @@ if(PCRE2_FOUND)
|
|||||||
message(STATUS "Using static PCRE2: ${PCRE2_STATIC_LIB}")
|
message(STATUS "Using static PCRE2: ${PCRE2_STATIC_LIB}")
|
||||||
elseif(TARGET PCRE2::PCRE2)
|
elseif(TARGET PCRE2::PCRE2)
|
||||||
target_link_libraries(3proxy PRIVATE PCRE2::PCRE2)
|
target_link_libraries(3proxy PRIVATE PCRE2::PCRE2)
|
||||||
|
message(STATUS "Using dynamic PCRE2 (PCRE2::PCRE2)")
|
||||||
else()
|
else()
|
||||||
target_link_libraries(3proxy PRIVATE ${PCRE2_LIBRARIES})
|
target_link_libraries(3proxy PRIVATE ${PCRE2_LIBRARIES})
|
||||||
|
message(STATUS "Using dynamic PCRE2: ${PCRE2_LIBRARIES}")
|
||||||
endif()
|
endif()
|
||||||
elseif(TARGET PCRE2::PCRE2)
|
elseif(TARGET PCRE2::PCRE2)
|
||||||
target_link_libraries(3proxy PRIVATE PCRE2::PCRE2)
|
target_link_libraries(3proxy PRIVATE PCRE2::PCRE2)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user