Skip to content

Commit

Permalink
fix release mac openssl sys for emqx (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
qzhuyan authored Nov 28, 2024
1 parent 43e1367 commit 97d8be9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
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

0 comments on commit 97d8be9

Please sign in to comment.