Created
March 22, 2010 15:04
-
-
Save tmpvar/340159 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/[email protected]/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