#! /usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006 (ita) VERSION='0.0.1' APPNAME='d_test' srcdir = '.' blddir = 'build' def set_options(opt): opt.tool_options('compiler_d') def configure(conf): conf.check_tool('compiler_d') if not conf.env.D_COMPILER: conf.fatal("either dmd or gdc is required (d compilers)") conf.env.LIB_PTHREAD = ['pthread'] def build(bld): bld.add_subdirs('src') # here is how to use the object-oriented notation obj = bld(features='d dstaticlib') obj.source = ''' testlib/code.d ''' obj.importpaths = '.' obj.name = 'testlib' obj.target = 'testlib' """ compiling with d, linking with gcc: * in the configuration, add conf.check_tool('gcc') * in the object creation, add 3 lines obj = bld('d') obj.source = ''' testlib/code.d ''' obj.features.append('cc') obj.features.append('cshlib') obj.name = 'testlib' obj.target = 'testlib' """ obj = bld(features='d dprogram') obj.source = ''' example.d ''' obj.target = 'd_test' obj.uselib_local = 'testlib' obj.uselib = 'PTHREAD' obj.importpaths = '.'