Skip to content

Commit

Permalink
Enable to build on Mac OS X 64 bits.
Browse files Browse the repository at this point in the history
  • Loading branch information
hokein committed Oct 10, 2014
1 parent 2d3c5a0 commit ac1b80c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
13 changes: 12 additions & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,19 @@
],
}],
['OS=="mac"', {
'conditions': [
['target_arch=="ia32"', {
'variables': {
'project_name': 'greenworks-osx32',
},
}],
['target_arch=="x64"', {
'variables': {
'project_name': 'greenworks-osx64',
},
}],
],
'variables': {
'project_name': 'greenworks-osx',
'redist_bin_dir': 'osx32',
'lib_steam': 'libsteam_api.dylib'
},
Expand Down
9 changes: 6 additions & 3 deletions lib/greenworks.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
var fs = require('fs');
var greenworks;

if (process.platform == 'darwin')
greenworks = require('../build/Release/greenworks-osx');
else if (process.platform == 'win32') {
if (process.platform == 'darwin') {
if (process.arch == 'x64')
greenworks = require('../build/Release/greenworks-osx64');
else if (process.arch == 'ia32')
greenworks = require('../build/Release/greenworks-osx32');
} else if (process.platform == 'win32') {
if (process.arch == 'x64')
greenworks = require('../build/Release/greenworks-win64');
else if (process.arch == 'ia32')
Expand Down
6 changes: 5 additions & 1 deletion src/greenworks_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,11 @@ void init(v8::Handle<v8::Object> exports) {
NODE_MODULE(greenworks_win64, init)
#endif
#elif defined(__APPLE__)
NODE_MODULE(greenworks_osx, init)
#if defined(__x86_64__) || defined(__ppc64__)
NODE_MODULE(greenworks_osx64, init)
#else
NODE_MODULE(greenworks_osx32, init)
#endif
#elif defined(__linux__)
#if defined(__x86_64__) || defined(__ppc64__)
NODE_MODULE(greenworks_linux64, init)
Expand Down

0 comments on commit ac1b80c

Please sign in to comment.