Skip to content

Instantly share code, notes, and snippets.

@tmpvar
Created March 22, 2010 15:04
Show Gist options
  • Save tmpvar/340159 to your computer and use it in GitHub Desktop.
Save tmpvar/340159 to your computer and use it in GitHub Desktop.
import Options
from os import popen, unlink, symlink, getcwd
from os import name as platform
from os.path import exists
import sys
srcdir = "."
blddir = "build"
VERSION = "0.0.1"
def set_options(opt):
opt.tool_options("compiler_cxx")
def configure(conf):
conf.check_tool("compiler_cxx")
conf.check_tool("node_addon")
def build(bld):
obj = bld.new_task_gen("cxx", "shlib", "node_addon")
obj.target = "uuid"
obj.find_sources_in_dirs("src")
# see http://www.mail-archive.com/programming@jsoftware.com/msg05886.html
if sys.platform == 'darwin':
obj.lib = ["System"]
else:
obj.lib = ["uuid"]
def shutdown(bld):
# HACK to get binding.node out of build directory.
# better way to do this?
if Options.commands['clean']:
if exists('uuid.node'): unlink('uuid.node')
else:
if exists('build/default/uuid.node') and not exists('uuid.node'):
symlink(getcwd()+'/build/default/uuid.node', 'uuid.node')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment