23phy / ewc

Native window composition on Windows for Electron apps.
MIT License
77 stars 7 forks source link

Failure installing on macOS #9

Open abettadapur opened 5 years ago

abettadapur commented 5 years ago

I get errors when running npm run rebuild on macOS. I am aware this is not a macOS library, but I am writing a cross platform application and require this library as a dependency for Windows platforms.

image

Could you help me here?

23phy commented 5 years ago

Seems to be a problem only with the exceptions. The -fno-exceptions flag comes from node's common.gypi file. This is supposed to make sure it doesn't use that flag. One method is to remove all the throw, try, catch statements but that's tedious. Another one is to tell the node-gyp to turn on the GCC_ENABLE_CPP_EXCEPTIONS. Download the master branch and try to compile it and see if it works, I've added a condition for OSX.

abettadapur commented 5 years ago

@23phy Thanks Ill give it a shot

abettadapur commented 5 years ago

@23phy Now it fails to find dwmapi.h, which I assume is the Windows specific header that makes this work...

I am not great with native code, any idea how to make this work on MacOSX? Perhaps we can skip compilation entirely, because we shouldn't be using it on this platform at all?

23phy commented 5 years ago

@abettadapur, you're using a native module, which kinda demands that you compile it on the target platform. A solution I see would require you to compile the module on Windows and include the .node file inside your packaged app, and then you load the module if you are running on that platform (Windows in this case).

Another method I was thinking would be so that Electron would already have some sort of bindings for dwm in an experimental branch or such. Hmm, I'll give it a try this week.