Skip to content

Commit

Permalink
fix:bug of cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxuan520 committed Nov 14, 2024
1 parent 88ec730 commit 71997e0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 27 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,6 @@ jobs:
fetch-depth: 0
submodules: true

- name: Install ubuntu build tools #这部分是安装依赖
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake
- name: Install macos build tools #这部分是安装依赖
if: matrix.os == 'macos-latest'
run: |
brew install cmake openssl
- name: Create Unix Release File
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: |
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,6 @@ jobs:
with:
submodules: true

- name: Install macos build tools #这部分是安装依赖
if: matrix.os == 'macos-latest'
run: |
wget https://www.openssl.org/source/openssl-1.1.1w.tar.gz
tar -xvf openssl-1.1.1w.tar.gz
cd openssl-1.1.1w
./config --prefix=/usr/local/openssl
make
sudo make install
export PATH=/usr/local/openssl/bin:$PATH
- name: Run in windows
if: matrix.os == 'windows-latest'
run: |
Expand Down
14 changes: 11 additions & 3 deletions src/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@ option(ENABLE_SSL "Enable SSL" on)
# ssl
if(ENABLE_SSL)
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# for author local mac
include_directories(/opt/homebrew/Cellar/openssl@3/3.3.2/include)
link_directories(/opt/homebrew/Cellar/openssl@3/3.3.2/lib)
set(OPENSSL_VERSION "")
execute_process(
COMMAND brew list --versions openssl
OUTPUT_VARIABLE OPENSSL_VERSION_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" OPENSSL_VERSION "${OPENSSL_VERSION_OUTPUT}")
message(STATUS "OpenSSL version: ${OPENSSL_VERSION}")

include_directories(/opt/homebrew/Cellar/openssl@3/${OPENSSL_VERSION}/include)
link_directories(/opt/homebrew/Cellar/openssl@3/${OPENSSL_VERSION}/lib)
endif()
add_definitions(-DCPPNET_OPENSSL)
link_libraries(-lssl -lcrypto)
Expand Down
13 changes: 11 additions & 2 deletions src/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,18 @@ option(ENABLE_SSL "Enable SSL" on)
# ssl
if(ENABLE_SSL)
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(OPENSSL_VERSION "")
execute_process(
COMMAND brew list --versions openssl
OUTPUT_VARIABLE OPENSSL_VERSION_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" OPENSSL_VERSION "${OPENSSL_VERSION_OUTPUT}")
message(STATUS "OpenSSL version: ${OPENSSL_VERSION}")

# for author local mac
include_directories(/opt/homebrew/Cellar/openssl@3/3.3.2/include)
link_directories(/opt/homebrew/Cellar/openssl@3/3.3.2/lib)
include_directories(/opt/homebrew/Cellar/openssl@3/${OPENSSL_VERSION}/include)
link_directories(/opt/homebrew/Cellar/openssl@3/${OPENSSL_VERSION}/lib)
endif()
add_definitions(-DCPPNET_OPENSSL)
link_libraries(-lssl -lcrypto)
Expand Down

0 comments on commit 71997e0

Please sign in to comment.