Commit e734d2ec by Ryan Dahl Committed by Orlando Vazquez

Use pkg-config in wscript, create symlink on build

parent ed365590
......@@ -3,3 +3,4 @@ README.html
test.db
.lock-wscript
speedtest.db
sqlite3_bindings.node
build/default/sqlite3_bindings.node
\ No newline at end of file
import Options
from os import unlink, symlink
from os.path import exists
srcdir = "."
blddir = "build"
VERSION = "0.0.1"
......@@ -8,10 +13,24 @@ def set_options(opt):
def configure(conf):
conf.check_tool("compiler_cxx")
conf.check_tool("node_addon")
if not conf.check_cfg(package='sqlite3', args='--cflags --libs', uselib_store='SQLITE3'):
conf.fatal('Missing sqlite3');
def build(bld):
obj = bld.new_task_gen("cxx", "shlib", "node_addon")
obj.cxxflags = "-g"
obj.target = "sqlite3_bindings"
obj.source = "sqlite3_bindings.cc"
obj.lib = "sqlite3"
#obj.lib = "sqlite3"
obj.uselib ="SQLITE3"
t = 'sqlite3_bindings.node'
def shutdown():
# HACK to get binding.node out of build directory.
# better way to do this?
if Options.commands['clean']:
if exists(t): unlink(t)
else:
if exists('build/default/' + t) and not exists(t):
symlink('build/default/' + t, t)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment