mirror of
https://github.com/3proxy/3proxy.git
synced 2026-05-01 08:20:12 +08:00
Update CMakeLists.txt
This commit is contained in:
parent
30bee085e9
commit
289fc04987
@ -105,7 +105,6 @@ if(WIN32)
|
||||
# MSVC-specific settings
|
||||
add_compile_definitions(
|
||||
MSVC
|
||||
WITH_SSL
|
||||
)
|
||||
# Use static runtime library
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
@ -123,7 +122,6 @@ if(WIN32)
|
||||
# clang-cl (Clang with MSVC frontend)
|
||||
add_compile_definitions(
|
||||
MSVC
|
||||
WITH_SSL
|
||||
)
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
add_compile_options(
|
||||
@ -254,14 +252,14 @@ endif()
|
||||
# OpenSSL
|
||||
set(OPENSSL_FOUND FALSE)
|
||||
if(3PROXY_USE_OPENSSL)
|
||||
find_package(OpenSSL QUIET)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
if(OpenSSL_FOUND)
|
||||
set(OPENSSL_FOUND TRUE)
|
||||
add_compile_definitions(WITH_SSL)
|
||||
message(STATUS "OpenSSL found: ${OPENSSL_VERSION}")
|
||||
else()
|
||||
message(STATUS "OpenSSL not found, SSLPlugin will not be built")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "OpenSSL disabled by user request")
|
||||
endif()
|
||||
|
||||
# PCRE2
|
||||
@ -302,6 +300,11 @@ if(NOT ODBC_FOUND)
|
||||
add_compile_definitions(NOODBC)
|
||||
endif()
|
||||
|
||||
# Set NORADIUS if OpenSSL is not available (RADIUS requires MD5 from OpenSSL)
|
||||
if(NOT OPENSSL_FOUND)
|
||||
add_compile_definitions(NORADIUS)
|
||||
endif()
|
||||
|
||||
# Source files for 3proxy core
|
||||
set(3PROXY_CORE_SOURCES
|
||||
src/3proxy.c
|
||||
@ -419,19 +422,17 @@ if(ODBC_FOUND)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(3proxy PRIVATE ${WINDOWS_LIBS})
|
||||
if(OpenSSL_FOUND)
|
||||
target_link_libraries(3proxy PRIVATE OpenSSL::SSL OpenSSL::Crypto)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(3proxy PRIVATE ${WINDOWS_LIBS})
|
||||
if(COMPILER_IS_MSVC AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/3proxy.rc)
|
||||
target_sources(3proxy PRIVATE 3proxy.rc)
|
||||
endif()
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
target_link_libraries(3proxy PRIVATE dl)
|
||||
if(OpenSSL_FOUND)
|
||||
target_link_libraries(3proxy PRIVATE OpenSSL::SSL OpenSSL::Crypto)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Build 3proxy_crypt utility
|
||||
|
||||
Loading…
Reference in New Issue
Block a user