Try and fix macOS build, report actial error on catch

This commit is contained in:
Alex Hultman 2018-11-05 02:22:20 +01:00
parent 9775ad1c9d
commit 5f7347d3c9
2 changed files with 7 additions and 3 deletions

View File

@ -2,7 +2,9 @@ C_SHARED := -DLIBUS_USE_LIBUV -flto -O3 -c -fPIC -I uWebSockets/uSockets/src uWe
CPP_SHARED := -DLIBUS_USE_LIBUV -flto -O3 -c -fPIC -std=c++17 -I uWebSockets/uSockets/src -I uWebSockets/src src/addon.cpp CPP_SHARED := -DLIBUS_USE_LIBUV -flto -O3 -c -fPIC -std=c++17 -I uWebSockets/uSockets/src -I uWebSockets/src src/addon.cpp
CPP_OSX := -stdlib=libc++ -mmacosx-version-min=10.7 -undefined dynamic_lookup C_OSX := -mmacosx-version-min=10.7
CPP_OSX := -stdlib=libc++ $(C_OSX)
default: default:
make targets make targets
@ -20,7 +22,9 @@ Linux:
g++ $(CPP_SHARED) -I $$NODE/include/node g++ $(CPP_SHARED) -I $$NODE/include/node
g++ -flto -O3 *.o -std=c++17 -shared -static-libstdc++ -static-libgcc -s -o dist/uws_linux_$$ABI.node g++ -flto -O3 *.o -std=c++17 -shared -static-libstdc++ -static-libgcc -s -o dist/uws_linux_$$ABI.node
Darwin: Darwin:
g++ $(CPP_SHARED) $(CPP_OSX) -I $$NODE/include/node -o dist/uws_darwin_$$ABI.node gcc $(C_OSX) $(C_SHARED)
g++ $(CPP_OSX) $(CPP_SHARED) -I $$NODE/include/node
g++ $(CPP_OSX) -flto -O3 *.o -std=c++17 -shared -undefined dynamic_lookup -o dist/uws_darwin_$$ABI.node
.PHONY: clean .PHONY: clean
clean: clean:
rm -f dist/README.md rm -f dist/README.md

2
dist/uws.js vendored
View File

@ -5,6 +5,6 @@ module.exports = (() => {
process.nextTick = (f, ...args) => uWS.nextTick(f.apply(...args)); process.nextTick = (f, ...args) => uWS.nextTick(f.apply(...args));
return uWS; return uWS;
} catch (e) { } catch (e) {
throw new Error('This version of µWS is not compatible with your Node.js build.'); throw new Error('This version of µWS is not compatible with your Node.js build.\n\n' + e.toString());
} }
})(); })();