OpenSSL find package (#6952)
* Change cmake to use find_package for openssl * Change cmake prefix paths * Fix Qt prefix path * Limit static to apple * Re-add qt bin path * Fix use of apple cmake variable * Update ChangeLog * Update CMake prefix path for mac and windows tests * Fix windows test * Seems to fix mac test * Brew defined prefix paths * Explicitly ensure all homebrew dependencies
This commit is contained in:
parent
b7a5da9404
commit
54cb817de8
13 changed files with 52 additions and 54 deletions
11
.github/workflows/job-test-mac.yml
vendored
11
.github/workflows/job-test-mac.yml
vendored
|
|
@ -16,14 +16,19 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: install qt
|
||||
run: brew install qt
|
||||
- name: Install brew dependencies
|
||||
run: |
|
||||
brew list qt5 &>/dev/null || brew install qt5
|
||||
brew list openssl &>/dev/null || brew install openssl
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/usr/local/opt/qt ..
|
||||
cmake \
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_PREFIX_PATH="$(brew --prefix qt5);$(brew --prefix openssl)" ..
|
||||
. ./version
|
||||
make -j
|
||||
|
||||
|
|
|
|||
12
.github/workflows/job-test-windows.yml
vendored
12
.github/workflows/job-test-windows.yml
vendored
|
|
@ -12,12 +12,12 @@ jobs:
|
|||
|
||||
env:
|
||||
GIT_COMMIT: ${{ github.sha }}
|
||||
QT_BASE_DIR: ${{ github.workspace }}\deps\Qt
|
||||
BONJOUR_BASE_DIR: ${{ github.workspace }}\deps\bonjour
|
||||
QT_BASE_DIR: ${{ github.workspace }}\deps\Qt
|
||||
QT_VERSION: 5.12.6
|
||||
QT_BASE_URL: http://qt.mirror.constant.com/
|
||||
BONJOUR_SDK_HOME: ${{ github.workspace }}\deps\bonjour\BonjourSDK
|
||||
CMAKE_PREFIX_PATH: ${{ github.workspace }}\deps\Qt\5.12.6\msvc2017_64\
|
||||
QT_LIB_DIR: ${{ github.workspace }}\deps\Qt\5.12.6
|
||||
OPENSSL_LIB_DIR: ${{ github.workspace }}\ext\openssl\windows
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
|
@ -34,7 +34,7 @@ jobs:
|
|||
run: |
|
||||
pip install aqtinstall
|
||||
python -m aqt install --outputdir $env:QT_BASE_DIR --base $env:QT_BASE_URL $env:QT_VERSION windows desktop win64_msvc2017_64
|
||||
cd $env:QT_BASE_DIR\$env:QT_VERSION\msvc2017_64
|
||||
cd $QT_LIB_DIR\msvc2017_64
|
||||
dir
|
||||
|
||||
- name: Cache Bonjour
|
||||
|
|
@ -47,7 +47,7 @@ jobs:
|
|||
- name: Install Bonjour SDK
|
||||
if: steps.cache-bonjour.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
New-Item -Force -ItemType Directory -Path ".\deps\bonjour"
|
||||
New-Item -Force -ItemType Directory -Path $env:BONJOUR_BASE_DIR"
|
||||
$client = new-object System.Net.WebClient
|
||||
$client.DownloadFile("https://binaries.symless.com/bonjour/BonjourSDK.zip",".\bonjoursdk.zip")
|
||||
[System.IO.Compression.ZipFile]::ExtractToDirectory(".\bonjoursdk.zip", $env:BONJOUR_BASE_DIR)
|
||||
|
|
@ -56,6 +56,8 @@ jobs:
|
|||
uses: microsoft/setup-msbuild@v1.0.2
|
||||
|
||||
- name: Build
|
||||
env:
|
||||
CMAKE_PREFIX_PATH: "${{ env.QT_LIB_DIR }}\\msvc2017_64\\;${{ env.OPENSSL_LIB_DIR }}\\x64"
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
|
|
|
|||
|
|
@ -34,13 +34,12 @@ steps:
|
|||
-DCMAKE_OSX_DEPLOYMENT_TARGET=$(version) \
|
||||
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CONFIGURATION_TYPES=Release \
|
||||
-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl \
|
||||
-DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib ..
|
||||
-DCMAKE_CONFIGURATION_TYPES=Release ..
|
||||
displayName: 'Cmake standard'
|
||||
condition: eq(variables['buildType'], 'standard')
|
||||
env:
|
||||
GIT_COMMIT: $(Build.SourceVersion)
|
||||
CMAKE_PREFIX_PATH: "$(Qt5_DIR);/usr/local/opt/openssl"
|
||||
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
|
|
@ -54,13 +53,12 @@ steps:
|
|||
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CONFIGURATION_TYPES=Release \
|
||||
-DSYNERGY_ENTERPRISE=ON \
|
||||
-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl \
|
||||
-DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib ..
|
||||
-DSYNERGY_ENTERPRISE=ON ..
|
||||
displayName: 'Cmake enterprise'
|
||||
condition: eq(variables['buildType'], 'enterprise')
|
||||
env:
|
||||
GIT_COMMIT: $(Build.SourceVersion)
|
||||
CMAKE_PREFIX_PATH: "$(Qt5_DIR);/usr/local/opt/openssl"
|
||||
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
|
|
@ -77,7 +75,7 @@ steps:
|
|||
- task: CmdLine@2
|
||||
inputs:
|
||||
script: |
|
||||
export PATH="$(QT_PATH):$(Qt5_DIR)/bin:$PATH"
|
||||
export PATH="$(Qt5_DIR)/bin:$PATH"
|
||||
macdeployqt $(Build.Repository.LocalPath)/build/bundle/Synergy.app -codesign="$CODESIGN_ID"
|
||||
codesign -f --options runtime --deep -s "$CODESIGN_ID" $(Build.Repository.LocalPath)/build/bundle/Synergy.app
|
||||
ln -s /Applications $(Build.Repository.LocalPath)/build/bundle/Applications
|
||||
|
|
|
|||
|
|
@ -51,17 +51,17 @@ steps:
|
|||
mkdir build64
|
||||
cd build64
|
||||
IF "$(buildType)"=="enterprise" (
|
||||
cmake -G "Visual Studio 16 2019" -A %MSARCH% -V -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=%QT_PATH% -DSYNERGY_ENTERPRISE=ON ..
|
||||
cmake -G "Visual Studio 16 2019" -A %MSARCH% -V -DCMAKE_BUILD_TYPE=Release -DSYNERGY_ENTERPRISE=ON ..
|
||||
) else (
|
||||
cmake -G "Visual Studio 16 2019" -A %MSARCH% -V -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=%QT_PATH% ..
|
||||
cmake -G "Visual Studio 16 2019" -A %MSARCH% -V -DCMAKE_BUILD_TYPE=Release ..
|
||||
)
|
||||
displayName: 'Cmake x64 Standard'
|
||||
env:
|
||||
ENV_BAT: $(ENV_BAT)
|
||||
BONJOUR_SDK_DIR: $(BONJOUR_SDK_DIR)
|
||||
QT_PATH: $(QT_BIN_PATH)
|
||||
MSARCH: 'x64'
|
||||
GIT_COMMIT: $(Build.SourceVersion)
|
||||
CMAKE_PREFIX_PATH: "$(QT_BIN_PATH);$(Build.Repository.LocalPath)\\ext\\openssl\\windows\\x64"
|
||||
|
||||
- script: |
|
||||
call "%ENV_BAT%" -arch=x64
|
||||
|
|
@ -79,17 +79,17 @@ steps:
|
|||
mkdir build32
|
||||
cd build32
|
||||
IF "$(buildType)"=="enterprise" (
|
||||
cmake -G "Visual Studio 16 2019" -A %MSARCH% -V -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=%QT_PATH% -DSYNERGY_ENTERPRISE=ON ..
|
||||
cmake -G "Visual Studio 16 2019" -A %MSARCH% -V -DCMAKE_BUILD_TYPE=Release -DSYNERGY_ENTERPRISE=ON ..
|
||||
) else (
|
||||
cmake -G "Visual Studio 16 2019" -A %MSARCH% -V -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=%QT_PATH% ..
|
||||
cmake -G "Visual Studio 16 2019" -A %MSARCH% -V -DCMAKE_BUILD_TYPE=Release ..
|
||||
)
|
||||
displayName: 'Cmake x32 Standard'
|
||||
env:
|
||||
ENV_BAT: $(ENV_BAT)
|
||||
BONJOUR_SDK_DIR: $(BONJOUR_SDK_DIR)
|
||||
QT_PATH: $(QT_BIN_PATH_32)
|
||||
MSARCH: 'Win32'
|
||||
GIT_COMMIT: $(Build.SourceVersion)
|
||||
CMAKE_PREFIX_PATH: "$(QT_BIN_PATH_32);$(Build.Repository.LocalPath)\\ext\\openssl\\windows\\x86"
|
||||
|
||||
- script: |
|
||||
call "%ENV_BAT%" -arch=x86
|
||||
|
|
|
|||
|
|
@ -315,31 +315,13 @@ endif()
|
|||
#
|
||||
# OpenSSL
|
||||
#
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
set (OPENSSL_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/ext/openssl/windows)
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set (OPENSSL_ROOT "${OPENSSL_ROOT}/x64")
|
||||
else()
|
||||
set (OPENSSL_ROOT "${OPENSSL_ROOT}/x86")
|
||||
endif()
|
||||
|
||||
include_directories (BEFORE SYSTEM ${OPENSSL_ROOT}/include)
|
||||
set (OPENSSL_LIBS
|
||||
${OPENSSL_ROOT}/lib/libssl.lib
|
||||
${OPENSSL_ROOT}/lib/libcrypto.lib
|
||||
)
|
||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set (OPENSSL_ROOT /usr/local/opt/openssl)
|
||||
include_directories (BEFORE SYSTEM ${OPENSSL_ROOT}/include)
|
||||
set (OPENSSL_LIBS
|
||||
${OPENSSL_ROOT}/lib/libssl.a
|
||||
${OPENSSL_ROOT}/lib/libcrypto.a
|
||||
)
|
||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux|.*BSD|DragonFly")
|
||||
set (OPENSSL_LIBS ssl crypto)
|
||||
else()
|
||||
message (FATAL_ERROR "Couldn't find OpenSSL")
|
||||
# Apple has to use static libraries because
|
||||
# "Use of the Apple-provided OpenSSL libraries by apps is strongly discouraged."
|
||||
# https://developer.apple.com/library/archive/documentation/Security/Conceptual/cryptoservices/SecureNetworkCommunicationAPIs/SecureNetworkCommunicationAPIs.html
|
||||
if(APPLE)
|
||||
set(OPENSSL_USE_STATIC_LIBS TRUE)
|
||||
endif()
|
||||
find_package(OpenSSL REQUIRED)
|
||||
|
||||
#
|
||||
# Check submodules
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ Enhancements:
|
|||
- #6938 Remove auto config message from the main window
|
||||
- #6941 Add Raspberry Pi Builds
|
||||
- #6949 Add a new option SYNERGY_AUTOCONFIG to exclude autoconfig from the standard version
|
||||
- #6952 Change OpenSSL logic to use find_package
|
||||
|
||||
v1.13.0-stable
|
||||
===========
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ endif()
|
|||
|
||||
add_executable(synergyc ${sources})
|
||||
target_link_libraries(synergyc
|
||||
arch base client common io mt net ipc platform server synlib ${libs} ${OPENSSL_LIBS})
|
||||
arch base client common io mt net ipc platform server synlib ${libs})
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
install (TARGETS synergyc DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR})
|
||||
|
|
|
|||
|
|
@ -24,4 +24,4 @@ else()
|
|||
endif()
|
||||
|
||||
target_link_libraries (synergyd
|
||||
arch base common io ipc mt net platform synlib shared ${libs} ${OPENSSL_LIBS})
|
||||
arch base common io ipc mt net platform synlib shared ${libs})
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ endif()
|
|||
|
||||
add_executable(synergys ${sources})
|
||||
target_link_libraries(synergys
|
||||
arch base client common io mt net ipc platform server synlib ${libs} ${OPENSSL_LIBS})
|
||||
arch base client common io mt net ipc platform server synlib ${libs})
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
install (TARGETS synergys DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR})
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ file(GLOB sources "*.cpp")
|
|||
|
||||
add_executable(syntool ${sources})
|
||||
target_link_libraries(syntool
|
||||
synlib arch base client common io ipc mt net platform server ${libs} ${OPENSSL_LIBS})
|
||||
synlib arch base client common io ipc mt net platform server ${libs})
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
install (TARGETS syntool DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR})
|
||||
|
|
|
|||
|
|
@ -22,7 +22,17 @@ if (SYNERGY_ADD_HEADERS)
|
|||
endif()
|
||||
|
||||
add_library(net STATIC ${sources})
|
||||
|
||||
if (UNIX)
|
||||
target_link_libraries(net mt io ${OPENSSL_LIBS})
|
||||
target_link_libraries(net
|
||||
PUBLIC
|
||||
OpenSSL::SSL
|
||||
PRIVATE
|
||||
mt
|
||||
io
|
||||
)
|
||||
if(WIN32)
|
||||
target_link_libraries(net
|
||||
PRIVATE
|
||||
Crypt32
|
||||
ws2_32
|
||||
)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -68,4 +68,4 @@ endif()
|
|||
|
||||
add_executable(integtests ${sources})
|
||||
target_link_libraries(integtests
|
||||
arch base client common io ipc mt net platform server synlib gtest gmock ${libs} ${OPENSSL_LIBS})
|
||||
arch base client common io ipc mt net platform server synlib gtest gmock ${libs})
|
||||
|
|
|
|||
|
|
@ -68,4 +68,4 @@ endif()
|
|||
|
||||
add_executable(unittests ${sources})
|
||||
target_link_libraries(unittests
|
||||
arch base client server common io net platform server synlib mt ipc gtest gmock shared ${libs} ${OPENSSL_LIBS})
|
||||
arch base client server common io net platform server synlib mt ipc gtest gmock shared ${libs})
|
||||
|
|
|
|||
Loading…
Reference in a new issue