Permalink
Browse files

working on windows compile

  • Loading branch information...
joeferner committed Apr 20, 2012
1 parent c256dd2 commit 3ee7c7bb61eb1a8abe0c52561299e55e07011792
Showing with 815 additions and 624 deletions.
  1. +22 −1 README.md
  2. BIN deps/wx-config.exe
  3. +44 −17 mnm.js
  4. +187 −176 render-templates.js
  5. +3 −0 src-generated/wxNode_wxAnyButton.cpp
  6. +6 −0 src-generated/wxNode_wxArtProvider.cpp
  7. +39 −84 src-generated/wxNode_wxBitmap.cpp
  8. +0 −3 src-generated/wxNode_wxBitmap.h
  9. +6 −0 src-generated/wxNode_wxBoxSizer.cpp
  10. +24 −0 src-generated/wxNode_wxButton.cpp
  11. +12 −0 src-generated/wxNode_wxCommandEvent.cpp
  12. +21 −0 src-generated/wxNode_wxControl.cpp
  13. +27 −142 src-generated/wxNode_wxCursor.cpp
  14. +0 −13 src-generated/wxNode_wxCursor.h
  15. +18 −0 src-generated/wxNode_wxDialog.cpp
  16. +18 −0 src-generated/wxNode_wxFrame.cpp
  17. +24 −0 src-generated/wxNode_wxIcon.cpp
  18. +9 −0 src-generated/wxNode_wxInfoBar.cpp
  19. +12 −0 src-generated/wxNode_wxKeyEvent.cpp
  20. +39 −0 src-generated/wxNode_wxListBox.cpp
  21. +9 −0 src-generated/wxNode_wxLogWindow.cpp
  22. +12 −0 src-generated/wxNode_wxMenu.cpp
  23. +12 −0 src-generated/wxNode_wxMenuBar.cpp
  24. +21 −29 src-generated/wxNode_wxMenuItem.cpp
  25. +0 −1 src-generated/wxNode_wxMenuItem.h
  26. +3 −0 src-generated/wxNode_wxNonOwnedWindow.cpp
  27. +18 −0 src-generated/wxNode_wxNotebook.cpp
  28. +12 −0 src-generated/wxNode_wxNotifyEvent.cpp
  29. +30 −0 src-generated/wxNode_wxPanel.cpp
  30. +12 −0 src-generated/wxNode_wxPoint.cpp
  31. +9 −0 src-generated/wxNode_wxSize.cpp
  32. +9 −0 src-generated/wxNode_wxSizerFlags.cpp
  33. +18 −0 src-generated/wxNode_wxStaticText.cpp
  34. +24 −0 src-generated/wxNode_wxTextCtrl.cpp
  35. +15 −29 src-generated/wxNode_wxTextEntryDialog.cpp
  36. +0 −1 src-generated/wxNode_wxTextEntryDialog.h
  37. +12 −0 src-generated/wxNode_wxTextValidator.cpp
  38. +18 −0 src-generated/wxNode_wxToolBar.cpp
  39. +18 −0 src-generated/wxNode_wxTopLevelWindow.cpp
  40. +3 −19 src-generated/wxNode_wxWebViewArchiveHandler.cpp
  41. +0 −2 src-generated/wxNode_wxWebViewArchiveHandler.h
  42. +9 −58 src-generated/wxNode_wxWebViewEvent.cpp
  43. +0 −2 src-generated/wxNode_wxWebViewEvent.h
  44. +6 −0 src-generated/wxNode_wxWebViewHistoryItem.cpp
  45. +18 −0 src-generated/wxNode_wxWindow.cpp
  46. +3 −0 src-templates/generic.cpp
  47. +6 −2 src/wxnode.h
  48. +7 −45 wxapi.xml
View
@@ -10,6 +10,27 @@ node.js wrapper for wxWidgets.
$ npm install wxnode
```
+## Installation Windows
+
+* Download wxWidgets 2.9.3.
+* Download and install node from source (release, 64-bit) "vcbuild.bat release"
+
+```bash
+cd d:\dev\wxWidgets-2.9.3\build\msw
+nmake -f makefile.vc BUILD=release UNICODE=1 RUNTIME_LIBS=static DEBUG_FLAG=0
+set WXWIN=d:\dev\wxWidgets-2.9.3
+set WXCFG=vc_lib\mswu
+cd d:\dev\wxNode
+node mnm.js build
+```
+
+## Try an example
+
+```javascript
+node examples/helloWorld.js
+node examples/...
+```
+
## Quick Examples
```javascript
@@ -42,7 +63,7 @@ var app = new MyApp();
app.run();
```
-## Building wxWidgets
+## Building wxWidgets linux
```bash
$ sudo apt-get install libwebkitgtk-dev
$ sudo ldconfig
View
Binary file not shown.
View
61 mnm.js
@@ -9,7 +9,7 @@ var RenderTemplates = require('./render-templates.js');
builder.appendIncludeDir('src/');
builder.appendIncludeDir('src-dummy/');
-function build(wxCxxFlags, wxLibs) {
+function build (wxCxxFlags, wxLibs) {
builder.appendUnique('CXXFLAGS', wxCxxFlags);
builder.appendUnique('LINKFLAGS', wxLibs);
@@ -23,33 +23,56 @@ function build(wxCxxFlags, wxLibs) {
}
var renderTemplates = true;
-for(var i=0; i<process.argv.length; i++) {
- if(process.argv[i] == '--skip-render-templates') {
+for (var i = 0; i < process.argv.length; i++) {
+ if (process.argv[i] == '--skip-render-templates') {
renderTemplates = false;
}
}
// get the wx command line flags
-runCommandLine('wx-config', ['--cxxflags'], function(err, wxCxxFlags) {
- if(err) { builder.fail(err); return; }
- runCommandLine('wx-config', ['--libs'], function(err, wxLibs) {
- if(err) { builder.fail(err); return; }
- if(renderTemplates) {
- RenderTemplates.renderTemplates(function(err){
- if(err) { builder.fail(err); return; }
+var wxConfigPath = 'wx-config';
+if (process.platform === 'win32') {
+ var wxHome = process.env['WXWIN'];
+ if (!wxHome) {
+ builder.fail("Could not find wxWidgets home. Set the WXWIN environment variable.");
+ }
+ if (!path.existsSync(wxHome)) {
+ builder.fail("Could not find wxWidgets home. WXWIN is pointing to an invalid directory. " + wxHome);
+ }
+ wxConfigPath = './deps/wx-config.exe';
+
+ builder.appendUnique('CXXFLAGS', '-DUNICODE');
+}
+
+runCommandLine(wxConfigPath, ['--cxxflags'], function (err, wxCxxFlags) {
+ if (err) {
+ builder.fail(err);
+ return;
+ }
+ runCommandLine(wxConfigPath, ['--libs'], function (err, wxLibs) {
+ if (err) {
+ builder.fail(err);
+ return;
+ }
+ if (renderTemplates) {
+ RenderTemplates.renderTemplates(function (err) {
+ if (err) {
+ builder.fail(err);
+ return;
+ }
build(wxCxxFlags, wxLibs);
});
- }else{
+ } else {
build(wxCxxFlags, wxLibs);
}
});
});
-String.prototype.trim = function() {
- return this.replace(/^\s+|\s+$/g,"");
-}
+String.prototype.trim = function () {
+ return this.replace(/^\s+|\s+$/g, "");
+};
-function runCommandLine(cmd, args, callback) {
+function runCommandLine (cmd, args, callback) {
var results = "";
var child = childProcess.spawn(cmd, args);
child.stdout.on('data', function (data) {
@@ -58,7 +81,11 @@ function runCommandLine(cmd, args, callback) {
child.stderr.on('data', function (data) {
results += data;
});
- child.on('exit', function(code) {
- callback(code, results.trim().split(' ').filter(function(item) { return item.length > 0; }));
+ child.on('exit', function (code) {
+ if (code != 0) {
+ callback(new Error(results));
+ return;
+ }
+ callback(code, results.trim().split(' ').filter(function (item) { return item.length > 0; }));
});
}
Oops, something went wrong.

0 comments on commit 3ee7c7b

Please sign in to comment.