Skip to content

Commit e2335b0

Browse files
big changes
1 parent 236b7b2 commit e2335b0

File tree

2 files changed

+30
-36
lines changed

2 files changed

+30
-36
lines changed

binding.gyp

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,49 +17,45 @@
1717
'addon/compression.h',
1818
'addon/compression.cpp'
1919
],
20-
'xcode_settings': {
21-
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
22-
'CLANG_CXX_LIBRARY': 'libc++',
23-
'MACOSX_DEPLOYMENT_TARGET': '11',
24-
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
25-
'OTHER_CFLAGS': [
26-
'-std=c++17',
27-
'-stdlib=libc++'
28-
],
29-
},
3020
'conditions': [
3121
[
3222
'OS=="win"',
3323
{
34-
'msvs_settings': {
35-
'VCCLCompilerTool': {
36-
'ExceptionHandling': 1,
37-
'AdditionalOptions': [
38-
'-std:c++17'
39-
]
40-
}
41-
},
42-
'include_dirs': [
43-
'<(module_root_dir)/deps/include'
44-
],
4524
'link_settings': {
4625
'libraries': [
47-
'<(module_root_dir)/deps/zstd/build/cmake/lib/libzstd.lib'
26+
'<(module_root_dir)/deps/zstd/build/cmake/lib/Debug/zstd_static.lib'
27+
]
28+
},
29+
},
30+
{ # macos and linux
31+
'link_settings': {
32+
'libraries': [
33+
'<(module_root_dir)/deps/zstd/build/cmake/lib/libzstd.a',
4834
]
49-
}
35+
},
5036
}
5137
]
5238
],
5339
'cflags!': [ '-fno-exceptions' ],
5440
'cflags_cc!': [ '-fno-exceptions' ],
5541
'cflags_cc': ['-std=c++17'],
56-
'msvs_settings': {
57-
'VCCLCompilerTool': { 'ExceptionHandling': 1 },
42+
'xcode_settings': {
43+
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
44+
'CLANG_CXX_LIBRARY': 'libc++',
45+
'MACOSX_DEPLOYMENT_TARGET': '11',
46+
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
47+
'OTHER_CFLAGS': [
48+
'-std=c++17',
49+
'-stdlib=libc++'
50+
],
5851
},
59-
'link_settings': {
60-
'libraries': [
61-
'<(module_root_dir)/deps/zstd/build/cmake/lib/libzstd.a',
62-
]
52+
'msvs_settings': {
53+
'VCCLCompilerTool': {
54+
'ExceptionHandling': 1,
55+
'AdditionalOptions': [
56+
'-std:c++17'
57+
]
58+
}
6359
},
6460
}]
6561
}

etc/install-zstd.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,16 @@ download_zstd() {
1111

1212
curl -L "https://github.com/facebook/zstd/releases/download/v1.5.6/zstd-1.5.6.tar.gz" \
1313
| tar -zxf - -C deps/zstd --strip-components 1
14-
15-
ls deps/zstd
1614
}
1715

1816
build_zstd() {
19-
export MACOSX_DEPLOYMENT_TARGET=10.12
17+
export MACOSX_DEPLOYMENT_TARGET=11
2018
cd deps/zstd/build/cmake
2119

22-
cmake -G "Unix Makefiles" .
23-
24-
echo "current dir: $(pwd)"
25-
make
20+
# CMAKE_RC_FLAGS is a workaround for a bug in 1.5.6 that breaks compilation on windows.
21+
# The fix is merged but not yet released. see https://github.com/facebook/zstd/issues/3999
22+
cmake -DCMAKE_RC_FLAGS="$(pwd)/lib" -DZSTD_MULTITHREAD_SUPPORT=OFF -DZSTD_BUILD_SHARED=OFF .
23+
cmake --build .
2624
}
2725

2826
clean_deps

0 commit comments

Comments
 (0)