Comments (5)
Using gyp with Emscripten on Windows seems complicated. A Visual Studio plugin might help: https://github.com/james-allison/vs-tool/tree/VS2013-Support
from nbind.
Yes, gyp on Windows is often troublesome, there are some workarounds posted (although I haven't tried them myself):
https://www.robertkehoe.com/2015/03/fix-node-gyp-rebuild-error-on-windows/
But what this Visual Studio plugin has to do with gyp? Will you be able to replace gyp project with Visual Studio (or, perhaps, CMake) project to build node extensions and/or invoke Emscripten?
BTW, you don't need a VS extension to invoke Emscripten, as it can be easily invoked from a command line/script as a custom build step in Visual Studio.
from nbind.
node-gyp
can generate a Makefile
that uses emcc
on Windows but neither Microsoft's nmake
nor GNU's gnumake
was able to run it, so it would be better to configure node-gyp
to generate a suitable .sln
or patch it afterwards to use emcc
. I didn't think that would be possible but will look into it. For Makefiles, it's easy to set CXX
in make_global_settings
in binding.gyp
.
The goal is that nbind
users could compile their project to a Node.js or Emscripten module by changing a single setting somewhere, in the same way on Windows, Linux and OS X.
The command npm run test-asm
in the feature/emscripten-support
branch already works on Linux and runs the same tests (using node-gyp
) as the native Node.js addon, but through Emscripten.
from nbind.
@bsergeev thanks for the hints, I got it working. Only problem is that it always re-compiles everything. I guess it will be up to the Visual Studio user to fix that manually somehow, but nbind
is now able to create a basic Emscripten solution that compiles (I'll commit it to feature/emscripten-support
soon and then npm run test-asm
will also work on Windows).
Now I'll have to fix a bug with callbacks when using the -O2
option in Emscripten, improve documentation and then it's ready for release. Rest of the missing features will go to issue #8.
from nbind.
Closing this now, the last missing things can be done later.
from nbind.
Related Issues (20)
- Delay in handoff from C++ to Node awaiter
- nbind doesn't work with electron-packager
- Can't pass char* from JS to cpp function HOT 1
- Windows | EMCC should have a batch file too. (emcc-path)
- Is there any way to call javascript method from c++ HOT 1
- Use of `eval` violates Content Security Policy in browsers HOT 7
- Incompatible with electron 4 and later? HOT 4
- NBind not working with Node 12.0.0
- Release on Node12 HOT 9
- Fail to build with electron 5.0.8, deprecated methods
- Problem when using with proton native HOT 1
- Node 13 build errors HOT 2
- unresolved external
- unresolved external HOT 2
- sample app refuses to run
- npm i produces error "type-check is deprecated" and "Type 'string' cannot be used to index type 'ExportType'."
- Error while dooing fourth step HOT 5
- Iterator support?
- Is this project dead? HOT 2
- std::string support is broken
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nbind.