Skip to content
Browse files

osx waf fix

  • Loading branch information...
1 parent 8c7802f commit 218377473a1f9d7107e0d18ddd2729f03077ce4e @oransel committed
Showing with 21 additions and 2 deletions.
  1. +1 −1 package.json
  2. +20 −1 wscript
View
2 package.json
@@ -2,7 +2,7 @@
"author": "Mustafa Oransel",
"name": "talib",
"description": "Technical Analysis Library",
- "version": "0.2.2",
+ "version": "0.2.3",
"homepage":"https://github.com/oransel/node-talib",
"repository": {
"type":"git",
View
21 wscript
@@ -1,3 +1,6 @@
+import sys
+import subprocess
+
def set_options(opt):
opt.tool_options("compiler_cxx")
@@ -5,9 +8,25 @@ def configure(conf):
conf.check_tool("compiler_cxx")
conf.check_tool("node_addon")
+def node_arch():
+ if sys.platform != 'darwin':
+ return
+ cmd = [ 'node', '-e', 'console.log(process.arch)' ]
+ p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ out = p.communicate()[0].split('\n')[0]
+ return out
+
def build(bld):
obj = bld.new_task_gen("cxx", "shlib", "node_addon")
- obj.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE", "-Wall"]
+ flags = ["-g","-O3","-Wall","-D_LARGEFILE_SOURCE"]
+ arch = node_arch()
+ arch_mappings = {'ia32': 'i386', 'x64': 'x86_64'}
+ if arch in arch_mappings:
+ arch = arch_mappings[arch]
+ flags += ['-arch', arch]
+ obj.cxxflags = flags
+ obj.ccflags = flags
+ obj.linkflags = flags
obj.target = "talib"
obj.source = "src/talib.cpp"
obj.add_obj_file("src/lib/src/.libs/libta_lib.a");

0 comments on commit 2183774

Please sign in to comment.
Something went wrong with that request. Please try again.