mirror of
https://github.com/lovell/sharp.git
synced 2025-07-10 11:00:14 +02:00
Auto-detect C++11 ABI version, remove --sharp-cxx11 flag
This commit is contained in:
parent
28ce33feb3
commit
07d66da57b
15
binding.gyp
15
binding.gyp
@ -51,7 +51,6 @@
|
||||
],
|
||||
# Nested variables "pattern" borrowed from http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi
|
||||
'variables': {
|
||||
'sharp_cxx11%': '0',
|
||||
'variables': {
|
||||
'variables': {
|
||||
'conditions': [
|
||||
@ -92,10 +91,6 @@
|
||||
'src/sharp.cc',
|
||||
'src/utilities.cc'
|
||||
],
|
||||
'defines': [
|
||||
'_GLIBCXX_USE_CXX11_ABI=<(sharp_cxx11)',
|
||||
'_ALLOW_KEYWORD_MACROS'
|
||||
],
|
||||
'include_dirs': [
|
||||
'<!(node -e "require(\'nan\')")'
|
||||
],
|
||||
@ -109,6 +104,10 @@
|
||||
}, {
|
||||
'libraries': ['<!@(PKG_CONFIG_PATH="<(pkg_config_path)" pkg-config --libs vips-cpp)']
|
||||
}]
|
||||
],
|
||||
'defines': [
|
||||
# Inspect libvips-cpp.so to determine which C++11 ABI version was used and set _GLIBCXX_USE_CXX11_ABI accordingly. This is quite horrible.
|
||||
'_GLIBCXX_USE_CXX11_ABI=<!(if readelf -Ws "$(PKG_CONFIG_PATH="<(pkg_config_path)" pkg-config --libs-only-L vips-cpp | cut -c 3-)/libvips-cpp.so" | c++filt | grep -qF __cxx11;then echo "1";else echo "0";fi)'
|
||||
]
|
||||
}, {
|
||||
# Attempt to download pre-built libvips and install locally within node_modules
|
||||
@ -119,6 +118,9 @@
|
||||
],
|
||||
'conditions': [
|
||||
['OS == "win"', {
|
||||
'defines': [
|
||||
'_ALLOW_KEYWORD_MACROS'
|
||||
],
|
||||
'libraries': [
|
||||
'../lib/libvips.lib',
|
||||
'../lib/libglib-2.0.lib',
|
||||
@ -142,6 +144,9 @@
|
||||
'variables': {
|
||||
'download_vips': '<!(LDD_VERSION="<!(ldd --version 2>&1 || true)" node -e "require(\'./binding\').download_vips()")'
|
||||
},
|
||||
'defines': [
|
||||
'_GLIBCXX_USE_CXX11_ABI=0'
|
||||
],
|
||||
'libraries': [
|
||||
'../lib/libvips-cpp.so',
|
||||
'../lib/libvips.so',
|
||||
|
@ -6,6 +6,8 @@ Requires libvips v8.3.3
|
||||
|
||||
#### v0.16.1 - TBD
|
||||
|
||||
* C++11 ABI version is now auto-detected, remove sharp-cxx11 installation flag.
|
||||
|
||||
* Ensure convolution kernel scale is clamped to a minimum value of 1.
|
||||
[#561](https://github.com/lovell/sharp/issues/561)
|
||||
[@abagshaw](https://github.com/abagshaw)
|
||||
|
@ -22,24 +22,15 @@ Most recent Linux-based operating systems with glibc running on x64 and ARMv6+ C
|
||||
* Debian 7, 8
|
||||
* Ubuntu 12.04, 14.04, 16.04
|
||||
* Centos 7
|
||||
* Fedora 22, 23
|
||||
* Fedora 23, 24
|
||||
* openSUSE 13.2
|
||||
* Archlinux
|
||||
* Raspbian Jessie
|
||||
* Amazon Linux 2016.03
|
||||
* Amazon Linux 2016.03, 2016.09
|
||||
|
||||
To use your own version of libvips instead of the provided binaries, make sure it is
|
||||
at least the version listed under `config.libvips` in the `package.json` file and
|
||||
that it can be located using `pkg-config --modversion vips-cpp`.
|
||||
|
||||
There are [changes in the C++11 ABI](https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html)
|
||||
when using v5.1+ of the `g++` compiler.
|
||||
If you have installed `libvips-dev` via package manager on an OS such as Debian testing/unstable,
|
||||
you can pass the required value of the `_GLIBCXX_USE_CXX11_ABI` macro using the `--sharp-cxx11` flag.
|
||||
|
||||
```sh
|
||||
npm install --sharp-cxx11=1
|
||||
```
|
||||
To use a globally-installed version of libvips instead of the provided binaries,
|
||||
make sure it is at least the version listed under `config.libvips` in the `package.json` file
|
||||
and that it can be located using `pkg-config --modversion vips-cpp`.
|
||||
|
||||
If you are using non-stadard paths (anything other than `/usr` or `/usr/local`),
|
||||
you might need to set `PKG_CONFIG_PATH` during `npm install`
|
||||
|
Loading…
x
Reference in New Issue
Block a user