- switch to normal OpenSSL libraries

This commit is contained in:
2026-02-01 19:37:23 +03:00
parent 4c02805452
commit d2e1b5e203
3 changed files with 17 additions and 9 deletions

View File

@@ -7,11 +7,12 @@ import shutil
# Temporary build directory # Temporary build directory
DIR_BUILD = 'build_android' DIR_BUILD = 'build_android'
# Android NDK home directory # Android NDK home directory
NDK_HOME = os.environ['ANDROID_NDK_HOME'] NDK_HOME = os.environ['ANDROID_NDK_HOME']
VCPKG_ROOT = os.environ['VCPKG_ROOT']
# CMake toolchain file # CMake toolchain file
TOOLCHAIN_FILE = f'{NDK_HOME}/build/cmake/android.toolchain.cmake' TOOLCHAIN_FILE = f'{NDK_HOME}/build/cmake/android.toolchain.cmake'
TOOLCHAIN_FILE_VCPKG=f'{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake'
# This directory # This directory
DIR_THIS = Path(__file__).parent.resolve() DIR_THIS = Path(__file__).parent.resolve()
@@ -23,9 +24,9 @@ def make_build() -> Path:
if Path(DIR_BUILD).exists(): if Path(DIR_BUILD).exists():
shutil.rmtree(DIR_BUILD) shutil.rmtree(DIR_BUILD)
os.mkdir(DIR_BUILD) os.mkdir(DIR_BUILD)
os.chdir(DIR_BUILD) os.chdir(DIR_BUILD)
cmd = f'cmake -DCMAKE_TOOLCHAIN_FILE={TOOLCHAIN_FILE} ' cmd = f'cmake -DCMAKE_TOOLCHAIN_FILE={TOOLCHAIN_FILE} -DCMAKE_TOOLCHAIN_FILE={TOOLCHAIN_FILE_VCPKG} '
cmd += f'-DANDROID_NDK=$NDK_HOME ' cmd += f'-DANDROID_NDK=$NDK_HOME '
cmd += f'-DANDROID_PLATFORM=24 ' cmd += f'-DANDROID_PLATFORM=24 '
cmd += f'-DCMAKE_BUILD=Release ' cmd += f'-DCMAKE_BUILD=Release '
@@ -34,11 +35,11 @@ def make_build() -> Path:
retcode = os.system(cmd) retcode = os.system(cmd)
if retcode != 0: if retcode != 0:
raise RuntimeError('Problem when configuring the project') raise RuntimeError('Problem when configuring the project')
cmd = f'cmake --build . -j {multiprocessing.cpu_count()}' cmd = f'cmake --build . -j {multiprocessing.cpu_count()}'
retcode = os.system(cmd) retcode = os.system(cmd)
if retcode != 0: if retcode != 0:
raise RuntimeError('Problem when building the project') raise RuntimeError('Problem when building the project')
if __name__ == '__main__': if __name__ == '__main__':
make_build() make_build()

View File

@@ -357,7 +357,7 @@ target_compile_definitions(rtphone PUBLIC ${DEFINES})
if (TARGET_LINUX) if (TARGET_LINUX)
target_link_options(rtphone PUBLIC -Wl,-Bstatic) target_link_options(rtphone PUBLIC -Wl,-Bstatic)
endif() endif()
target_link_libraries(rtphone PUBLIC ${LIBS_STATIC} ${OPENSSL_SSL} ${OPENSSL_CRYPTO}) target_link_libraries(rtphone PUBLIC ${LIBS_STATIC})
if (TARGET_LINUX) if (TARGET_LINUX)
target_link_options(rtphone PUBLIC -Wl,-Bdynamic) target_link_options(rtphone PUBLIC -Wl,-Bdynamic)
@@ -384,3 +384,7 @@ target_include_directories(rtphone
# For MSVC static builds # For MSVC static builds
# set_property(TARGET rtphone PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") # set_property(TARGET rtphone PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
find_package(OpenSSL REQUIRED)
target_link_libraries(rtphone PUBLIC OpenSSL::SSL)
target_link_libraries(rtphone PUBLIC OpenSSL::Crypto)

View File

@@ -368,5 +368,8 @@ else()
set (RESIP_DEFINES ${RESIP_DEFINES} -DHAVE_ARPA_NAMESER_H) set (RESIP_DEFINES ${RESIP_DEFINES} -DHAVE_ARPA_NAMESER_H)
endif() endif()
find_package(OpenSSL)
target_compile_definitions(resiprocate PUBLIC ${RESIP_DEFINES}) target_compile_definitions(resiprocate PUBLIC ${RESIP_DEFINES})
target_link_libraries (resiprocate PUBLIC ${OPENSSL_SSL} ${OPENSSL_CRYPTO})
target_link_libraries(resiprocate PUBLIC OpenSSL::SSL)
target_link_libraries(resiprocate PUBLIC OpenSSL::Crypto)