Skip to content

Instantly share code, notes, and snippets.

@pagameba
Created November 29, 2010 16:48
Show Gist options
  • Save pagameba/720185 to your computer and use it in GitHub Desktop.
Save pagameba/720185 to your computer and use it in GitHub Desktop.
import Options
import sys
from os import unlink, symlink, popen
from os.path import exists
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")
conf.check_cfg(path='gdal-config', args='--cflags --libs',
package='', uselib_store='GDAL')
if sys.platform == 'darwin':
conf.check_tool('osx')
def build(bld):
obj = bld.new_task_gen("cxx", "shlib", "node_addon")
obj.target = "node_ogr"
obj.source = "src/node_ogr.cc"
obj.uselib = "GDAL"
def shutdown():
if Options.commands['clean']:
if exists('node_ogr.node'): unlink('node_ogr.node')
else:
if exists('build/default/node_ogr.node') and not exists('node_ogr.node'):
symlink('build/default/node_ogr.node', 'node_ogr.node')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment