From 5f7347d3c9404fc8c986cbbc63c958f13508171b Mon Sep 17 00:00:00 2001 From: Alex Hultman Date: Mon, 5 Nov 2018 02:22:20 +0100 Subject: [PATCH] Try and fix macOS build, report actial error on catch --- Makefile | 8 ++++++-- dist/uws.js | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 80ef015..8a55c23 100644 --- a/Makefile +++ b/Makefile @@ -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_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: make targets @@ -20,7 +22,9 @@ Linux: 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 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 clean: rm -f dist/README.md diff --git a/dist/uws.js b/dist/uws.js index d9a46b5..b0d8282 100644 --- a/dist/uws.js +++ b/dist/uws.js @@ -5,6 +5,6 @@ module.exports = (() => { process.nextTick = (f, ...args) => uWS.nextTick(f.apply(...args)); return uWS; } 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()); } })();