C# support. A simple example:
def configure(conf):
conf.load('cs')
def build(bld):
bld(features='cs', source='main.cs', gen='foo')
Note that the configuration may compile C# snippets:
FRAG = '''
namespace Moo {
public class Test { public static int Main(string[] args) { return 0; } }
}'''
def configure(conf):
conf.check(features='cs', fragment=FRAG, compile_filename='test.cs', gen='test.exe',
type='exe', csflags=['-pkg:gtk-sharp-2.0'], msg='Checking for Gtksharp support')
Task generator method
Create a C# task bound to the attribute cs_task. There can be only one C# task by task generator.
Feature : | cs |
---|
Task generator method
C# applications honor the use keyword:
def build(bld):
bld(features='cs', source='My.cs', type='library', gen='my.dll', name='mylib')
bld(features='cs', source='Hi.cs', includes='.', type='exe', gen='hi.exe', use='mylib', name='hi')
Feature : | cs |
---|
Task generator method
The C# targets may create .mdb or .pdb files:
def build(bld):
bld(features='cs', source='My.cs', type='library', gen='my.dll', csdebug='full')
# csdebug is a value in [True, 'full', 'pdbonly']
Feature : | cs |
---|
Bases: waflib.Task.Task
Compile C# files
Find a C# compiler, set the variable MCS for the compiler and CS_NAME (mono or csc)
Add a command-line option for the configuration:
$ waf configure --with-csc-binary=/foo/bar/mcs
Bases: waflib.Task.Task
Task used for reading a foreign .net assembly and adding the dependency on it
Configuration Method bound to waflib.Configure.ConfigurationContext
Read a foreign .net assembly for the use system:
def build(bld):
bld.read_csshlib('ManagedLibrary.dll', paths=[bld.env.mylibrarypath])
bld(features='cs', source='Hi.cs', type='exe', gen='hi.exe', use='ManagedLibrary.dll')
Parameters: |
|
---|---|
Returns: | A task generator having the feature fake_lib which will call waflib.Tools.ccroot.process_lib() |
Return type: |
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 |
---|
Features defined in this module: