c_osx
MacOSX related tools
- waflib.Tools.c_osx.taskgen_method(func)
Decorator that registers method as a task generator method. The function must accept a task generator as first parameter:
from waflib.TaskGen import taskgen_method @taskgen_method def mymethod(self): pass
- Parameters:
func (function) – task generator method to add
- Return type:
function
- waflib.Tools.c_osx.feature(*k)
Decorator that registers a task generator method that will be executed when the object attribute
feature
contains the corresponding key(s):from waflib.TaskGen 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
- waflib.Tools.c_osx.after_method(*k)[source]
Decorator that registers 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
- waflib.Tools.c_osx.before_method(*k)[source]
Decorator that registera 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
- waflib.Tools.c_osx.app_info = '\n<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">\n<plist version="0.9">\n<dict>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleGetInfoString</key>\n\t<string>Created by Waf</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>NOTE</key>\n\t<string>THIS IS A GENERATED FILE, DO NOT MODIFY</string>\n\t<key>CFBundleExecutable</key>\n\t<string>{app_name}</string>\n</dict>\n</plist>\n'
plist template
- waflib.Tools.c_osx.set_macosx_deployment_target(self)[source]
Task generator method
see WAF issue 285 and also and also http://trac.macports.org/ticket/17059
- waflib.Tools.c_osx.create_bundle_dirs(self, name, out)[source]
Task generator method
Creates bundle folders, used by
create_task_macplist()
andcreate_task_macapp()
- waflib.Tools.c_osx.create_task_macapp(self)[source]
Task generator method
To compile an executable into a Mac application (a .app), set its mac_app attribute:
def build(bld): bld.shlib(source='a.c', target='foo', mac_app=True)
To force all executables to be transformed into Mac applications:
def build(bld): bld.env.MACAPP = True bld.shlib(source='a.c', target='foo')
- Feature:
- waflib.Tools.c_osx.create_task_macplist(self)[source]
Task generator method
Creates a
waflib.Tools.c_osx.macplist
instance.- Feature:
- waflib.Tools.c_osx.apply_bundle(self)[source]
Task generator method
To make a bundled shared library (a
.bundle
), set the mac_bundle attribute:def build(bld): bld.shlib(source='a.c', target='foo', mac_bundle = True)
To force all executables to be transformed into bundles:
def build(bld): bld.env.MACBUNDLE = True bld.shlib(source='a.c', target='foo')
- class waflib.Tools.c_osx.macapp(*k, **kw)[source]
Creates mac applications
- color = 'PINK'
Color for the console display, see
waflib.Logs.colors_lst
- hasrun
- generator
- env
waflib.ConfigSet.ConfigSet
object (make sure to provide one)
- inputs
List of input nodes, which represent the files used by the task instance
- outputs
List of output nodes, which represent the files created by the task instance
- dep_nodes
List of additional nodes to depend on
- run_after
Set of tasks that must be executed before this one
- hcode = b'\tdef run(self):\n\t\tself.outputs[0].parent.mkdir()\n\t\tshutil.copy2(self.inputs[0].srcpath(), self.outputs[0].abspath())\n'
String representing an additional hash for the class representation
- class waflib.Tools.c_osx.macplist(*k, **kw)[source]
Creates plist files
- color = 'PINK'
Color for the console display, see
waflib.Logs.colors_lst
- ext_in = ['.bin']
File extensions that objects of this task class may use
- hasrun
- generator
- env
waflib.ConfigSet.ConfigSet
object (make sure to provide one)
- inputs
List of input nodes, which represent the files used by the task instance
- outputs
List of output nodes, which represent the files created by the task instance
- dep_nodes
List of additional nodes to depend on
- run_after
Set of tasks that must be executed before this one
- hcode = b"\tdef run(self):\n\t\tif getattr(self, 'code', None):\n\t\t\ttxt = self.code\n\t\telse:\n\t\t\ttxt = self.inputs[0].read()\n\t\tcontext = getattr(self, 'context', {})\n\t\ttxt = txt.format(**context)\n\t\tself.outputs[0].write(txt)\n"
String representing an additional hash for the class representation
Features defined in this module: