Support for Ruby extensions. A C/C++ compiler is required:
def options(opt):
opt.load('compiler_c ruby')
def configure(conf):
conf.load('compiler_c ruby')
conf.check_ruby_version((1,8,0))
conf.check_ruby_ext_devel()
conf.check_ruby_module('libxml')
def build(bld):
bld(
features = 'c cshlib rubyext',
source = 'rb_mytest.c',
target = 'mytest_ext',
install_path = '${ARCHDIR_RUBY}')
bld.install_files('${LIBDIR_RUBY}', 'Mytest.rb')
Task generator method
Add required variables for ruby extensions
Feature : | rubyext |
---|
Task generator method
Strip the lib prefix from ruby extensions
Feature : | rubyext |
---|
Configuration Method bound to waflib.Configure.ConfigurationContext
Checks if ruby is installed. If installed the variable RUBY will be set in environment. The ruby binary can be overridden by --with-ruby-binary command-line option.
Configuration Method bound to waflib.Configure.ConfigurationContext
Check if a ruby extension can be created
Configuration Method bound to waflib.Configure.ConfigurationContext
Check if the selected ruby interpreter can require the given ruby module:
def configure(conf):
conf.check_ruby_module('libxml')
Parameters: | module_name (string) – module |
---|
Bases: waflib.Task.Task
Task to run ruby files detected by file extension .rb:
def options(opt):
opt.load('ruby')
def configure(ctx):
ctx.check_ruby_version()
def build(bld):
bld.env['RBFLAGS'] = '-e puts "hello world"'
bld(source='a_ruby_file.rb')
Add the --with-ruby-archdir, --with-ruby-libdir and --with-ruby-binary options
Decorator: attach new configuration functions to waflib.Build.BuildContext and waflib.Configure.ConfigurationContext. The methods bound will accept a parameter named ‘mandatory’ to disable the configuration errors:
def configure(conf):
conf.find_program('abc', mandatory=False)
Parameters: | f (function) – method to bind |
---|
Decorator: register a task generator method that will be executed when the object attribute ‘feature’ contains the corresponding key(s):
from waflib.Task import feature
@feature('myfeature')
def myfunction(self):
print('that is my feature!')
def build(bld):
bld(features='myfeature')
Parameters: | k (list of string) – feature names |
---|
Decorator: register a task generator method which will be executed before the functions of given name(s):
from waflib.TaskGen import feature, before
@feature('myfeature')
@before_method('fun2')
def fun1(self):
print('feature 1!')
@feature('myfeature')
def fun2(self):
print('feature 2!')
def build(bld):
bld(features='myfeature')
Parameters: | k (list of string) – method names |
---|
Decorator: register a task generator method which will be executed after the functions of given name(s):
from waflib.TaskGen import feature, after
@feature('myfeature')
@after_method('fun2')
def fun1(self):
print('feature 1!')
@feature('myfeature')
def fun2(self):
print('feature 2!')
def build(bld):
bld(features='myfeature')
Parameters: | k (list of string) – method names |
---|
Decorator: register a task generator method which will be invoked during the processing of source files for the extension given:
from waflib import Task
class mytask(Task):
run_str = 'cp ${SRC} ${TGT}'
@extension('.moo')
def create_maa_file(self, node):
self.create_task('mytask', node, node.change_ext('.maa'))
def build(bld):
bld(source='foo.moo')
Features defined in this module: