Skip to content

Commit

Permalink
Trying to come up with a flexible way to include applink
Browse files Browse the repository at this point in the history
  • Loading branch information
absurdfarce committed Nov 4, 2024
1 parent 5b3112e commit ec56602
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,13 @@ jobs:
- name: Set PATH to find vcpkg dependencies
run: |
echo "PATH=${{ env.PATH }};${{ env.LIBUV_BIN_DIR }};${{ env.KERBEROS_BIN_DIR }};${{ env.OPENSSL_BIN_DIR }}" >> $env:GITHUB_ENV
- name: Link OpenSSL applink.c into src
run: |
echo "OPENSSL_INCLUDE_DIR contents:"
ls ${{ env.OPENSSL_INCLUDE_DIR }}\openssl
ln -s ${{ env.OPENSSL_INCLUDE_DIR }}\openssl\applink.c .\src\applink.c
- name: Fix name of static zlib dir
run: ln -s ${{ env.ZLIB_LIB_DIR }}\zlib.lib ${{ env.ZLIB_LIB_DIR }}\zlibstatic.lib
- name: Build and run tests
run: |
mkdir build
cd build
cmake -G "NMake Makefiles" -DCASS_BUILD_UNIT_TESTS=On ..
cmake -G "NMake Makefiles" -DCASS_BUILD_UNIT_TESTS=On -DCASS_OPENSSL_APPLINK=${{ env.OPENSSL_INCLUDE_DIR }}\openssl\applink.c ..
nmake
ls .
ldd ./cassandra-unit-tests.exe
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ set(CASS_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(CASS_SRC_DIR "${CASS_ROOT_DIR}/src")
set(CASS_INCLUDE_DIR "${CASS_ROOT_DIR}/include")

# Allow user to specify the location of applink.c. Some Windows builds require this as an
# interface into OpenSSL BIO ops. See https://docs.openssl.org/1.1.1/man3/OPENSSL_Applink/#synopsis
set(CASS_OPENSSL_APPLINK "")

# Ensure functions/modules are available
list(APPEND CMAKE_MODULE_PATH ${CASS_ROOT_DIR}/cmake)

Expand Down
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ endif()

if(CASS_USE_OPENSSL)
list(APPEND SOURCES ssl/ssl_openssl_impl.cpp ssl/ring_buffer_bio.cpp)
if(WIN32 AND (NOT CASS_OPENSSL_APPLINK STREQUAL ""))
list(APPEND SOURCES ${CASS_OPENSSL_APPLINK})
endif()
else()
list(APPEND SOURCES ssl/ssl_no_impl.cpp)
endif()
Expand Down

0 comments on commit ec56602

Please sign in to comment.