Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix release mac openssl sys for emqx #324

Merged
merged 2 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ jobs:
os:
- macos-14
otp:
- 25
- 26
openssl:
- openssl3
- openssl
- sys
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
Expand All @@ -51,6 +54,8 @@ jobs:
brew install erlang@${{ matrix.otp }}
echo "$(brew --prefix erlang@${{ matrix.otp }})/bin" >> $GITHUB_PATH
- name: release build
env:
QUICER_TLS_VER: ${{ matrix.openssl }}
run: |
wget https://s3.amazonaws.com/rebar3/rebar3
sudo mv rebar3 /usr/local/bin/ && sudo chmod +x /usr/local/bin/rebar3
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
fail-fast: false
matrix:
otp:
- 25
- 26
openssl:
- openssl3
Expand Down
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if (DEFINED ENV{QUICER_TLS_VER})
endif()
set(QUIC_USE_SYSTEM_LIBCRYPTO "ON")
else()
set(QUIC_TLS $ENV{QUICER_TLS_VER})
set(QUIC_TLS $ENV{QUICER_TLS_VER} CACHE STRING "QUIC_TLS")
endif()

endif()
Expand Down Expand Up @@ -173,8 +173,12 @@ endif()

add_library(quicer_nif SHARED ${SOURCES})

# for macOS Workaround to use opensslquic head files.
target_include_directories(quicer_nif PUBLIC "c_build/_deps/opensslquic-build/openssl/include")
if (OPENSSL_INCLUDE_DIR)
# for sys crypto
target_include_directories(quicer_nif PUBLIC ${OPENSSL_INCLUDE_DIR})
else()
target_include_directories(quicer_nif PUBLIC "c_build/_deps/opensslquic-build/${QUIC_TLS}/include")
endif()

if (CMAKE_SYSTEM_NAME MATCHES Linux)
target_link_libraries(quicer_nif PRIVATE quicer_static "-Wl,--no-gc-sections -pthread") # no gc because of erlang nif symbols
Expand Down