Skip to content

Commit b5ba84b

Browse files
committed
Update GmSSL v3.2.0 compatibility
1 parent 85322d6 commit b5ba84b

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run: |
2727
sudo apt-get update
2828
sudo apt-get install -y cmake build-essential
29-
git clone https://github.com/guanzhi/GmSSL.git /tmp/GmSSL
29+
git clone --depth 1 --branch v3.2.0 https://github.com/guanzhi/GmSSL.git /tmp/GmSSL
3030
cd /tmp/GmSSL
3131
mkdir build && cd build
3232
cmake ..
@@ -40,7 +40,7 @@ jobs:
4040
if: runner.os == 'macOS'
4141
run: |
4242
brew install cmake
43-
git clone https://github.com/guanzhi/GmSSL.git /tmp/GmSSL
43+
git clone --depth 1 --branch v3.2.0 https://github.com/guanzhi/GmSSL.git /tmp/GmSSL
4444
cd /tmp/GmSSL
4545
mkdir build && cd build
4646
cmake ..
@@ -90,7 +90,7 @@ jobs:
9090
run: |
9191
sudo apt-get update
9292
sudo apt-get install -y cmake build-essential
93-
git clone https://github.com/guanzhi/GmSSL.git /tmp/GmSSL
93+
git clone --depth 1 --branch v3.2.0 https://github.com/guanzhi/GmSSL.git /tmp/GmSSL
9494
cd /tmp/GmSSL
9595
mkdir build && cd build
9696
cmake ..

binding.gyp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
"sources": ["src/gmssl.cc"],
66
"include_dirs": [
77
"<!@(node -p \"require('node-addon-api').include\")",
8-
"/usr/local/include"
8+
"<!(node -p \"(process.env.GMSSL_ROOT || '/usr/local') + '/include'\")"
9+
],
10+
"libraries": [
11+
"<!(node -p \"'-L' + (process.env.GMSSL_ROOT || '/usr/local') + '/lib'\")",
12+
"-lgmssl"
913
],
10-
"libraries": ["-L/usr/local/lib", "-lgmssl"],
1114
"cflags!": ["-fno-exceptions"],
1215
"cflags_cc!": ["-fno-exceptions"],
1316
"cflags_cc": ["-std=c++17"],
@@ -19,13 +22,19 @@
1922
"CLANG_CXX_LIBRARY": "libc++",
2023
"MACOSX_DEPLOYMENT_TARGET": "10.15",
2124
"OTHER_CFLAGS": ["-std=c++17"],
22-
"OTHER_LDFLAGS": ["-L/usr/local/lib", "-lgmssl", "-Wl,-rpath,/usr/local/lib"]
25+
"OTHER_LDFLAGS": [
26+
"<!(node -p \"'-L' + (process.env.GMSSL_ROOT || '/usr/local') + '/lib'\")",
27+
"-lgmssl",
28+
"<!(node -p \"'-Wl,-rpath,' + (process.env.GMSSL_ROOT || '/usr/local') + '/lib'\")"
29+
]
2330
},
2431
"libraries": []
2532
}],
2633
["OS=='linux'", {
2734
"cflags_cc": ["-std=c++17"],
28-
"ldflags": ["-Wl,-rpath,/usr/local/lib"]
35+
"ldflags": [
36+
"<!(node -p \"'-Wl,-rpath,' + (process.env.GMSSL_ROOT || '/usr/local') + '/lib'\")"
37+
]
2938
}]
3039
]
3140
}

0 commit comments

Comments
 (0)