Skip to content

Commit ec56602

Browse files
committed
Trying to come up with a flexible way to include applink
1 parent 5b3112e commit ec56602

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

.github/workflows/test.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,13 @@ jobs:
2626
- name: Set PATH to find vcpkg dependencies
2727
run: |
2828
echo "PATH=${{ env.PATH }};${{ env.LIBUV_BIN_DIR }};${{ env.KERBEROS_BIN_DIR }};${{ env.OPENSSL_BIN_DIR }}" >> $env:GITHUB_ENV
29-
- name: Link OpenSSL applink.c into src
30-
run: |
31-
echo "OPENSSL_INCLUDE_DIR contents:"
32-
ls ${{ env.OPENSSL_INCLUDE_DIR }}\openssl
33-
ln -s ${{ env.OPENSSL_INCLUDE_DIR }}\openssl\applink.c .\src\applink.c
3429
- name: Fix name of static zlib dir
3530
run: ln -s ${{ env.ZLIB_LIB_DIR }}\zlib.lib ${{ env.ZLIB_LIB_DIR }}\zlibstatic.lib
3631
- name: Build and run tests
3732
run: |
3833
mkdir build
3934
cd build
40-
cmake -G "NMake Makefiles" -DCASS_BUILD_UNIT_TESTS=On ..
35+
cmake -G "NMake Makefiles" -DCASS_BUILD_UNIT_TESTS=On -DCASS_OPENSSL_APPLINK=${{ env.OPENSSL_INCLUDE_DIR }}\openssl\applink.c ..
4136
nmake
4237
ls .
4338
ldd ./cassandra-unit-tests.exe

CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ set(CASS_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
55
set(CASS_SRC_DIR "${CASS_ROOT_DIR}/src")
66
set(CASS_INCLUDE_DIR "${CASS_ROOT_DIR}/include")
77

8+
# Allow user to specify the location of applink.c. Some Windows builds require this as an
9+
# interface into OpenSSL BIO ops. See https://docs.openssl.org/1.1.1/man3/OPENSSL_Applink/#synopsis
10+
set(CASS_OPENSSL_APPLINK "")
11+
812
# Ensure functions/modules are available
913
list(APPEND CMAKE_MODULE_PATH ${CASS_ROOT_DIR}/cmake)
1014

src/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ endif()
1313

1414
if(CASS_USE_OPENSSL)
1515
list(APPEND SOURCES ssl/ssl_openssl_impl.cpp ssl/ring_buffer_bio.cpp)
16+
if(WIN32 AND (NOT CASS_OPENSSL_APPLINK STREQUAL ""))
17+
list(APPEND SOURCES ${CASS_OPENSSL_APPLINK})
18+
endif()
1619
else()
1720
list(APPEND SOURCES ssl/ssl_no_impl.cpp)
1821
endif()

0 commit comments

Comments
 (0)