c_osx¶
MacOSX related tools
-
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
Feature: c, cxx
-
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: cprogram, cxxprogram
-
waflib.Tools.c_osx.
create_task_macplist
(self)[source]¶ Task generator method
Creates a
waflib.Tools.c_osx.macplist
instance.Feature: cprogram, cxxprogram
-
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')
Feature: cshlib, cxxshlib
-
class
waflib.Tools.c_osx.
macapp
(*k, **kw)[source]¶ Bases:
waflib.Task.Task
Creates mac applications
-
color
= 'PINK'¶
-
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'¶
-
-
class
waflib.Tools.c_osx.
macplist
(*k, **kw)[source]¶ Bases:
waflib.Task.Task
Creates plist files
-
color
= 'PINK'¶
-
ext_in
= ['.bin']¶
-
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"¶
-
-
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.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
-
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
Features defined in this module: