waf: cmake: improve documentation regarding target option
That feature can also be used within wscripts with no problem. The code added in the example shows that.
This commit is contained in:
parent
76bae701a8
commit
4f82120c8f
@ -64,11 +64,10 @@ OrderedDict. Example::
|
|||||||
...
|
...
|
||||||
)
|
)
|
||||||
|
|
||||||
There may be cases when you want to stablish dependency between other tasks and
|
There may be cases when you want to establish dependency between other tasks and
|
||||||
the external build system's products (headers and libraries, for example). In
|
the external build system's products (headers and libraries, for example). In
|
||||||
that case, you can specify the specific files in the option 'target' of your
|
that case, you can specify the specific files in the option 'target' of your
|
||||||
cmake_build task generator. In general, that feature is supposed to be used by
|
cmake_build task generator. Example::
|
||||||
other tools rather than by wscripts. Example::
|
|
||||||
|
|
||||||
def build(bld):
|
def build(bld):
|
||||||
...
|
...
|
||||||
@ -76,6 +75,22 @@ other tools rather than by wscripts. Example::
|
|||||||
# declaring on target only what I'm interested in
|
# declaring on target only what I'm interested in
|
||||||
foo.cmake_build('baz', target='path/to/foobld/include/baz.h')
|
foo.cmake_build('baz', target='path/to/foobld/include/baz.h')
|
||||||
|
|
||||||
|
# myprogram.c includes baz.h, so the dependency is (implicitly)
|
||||||
|
# established
|
||||||
|
bld.program(target='myprogram', source='myprogram.c')
|
||||||
|
|
||||||
|
# another example
|
||||||
|
foo.cmake_build('another', target='another.txt')
|
||||||
|
|
||||||
|
bld(
|
||||||
|
rule='${CP} ${SRC} ${TGT}',
|
||||||
|
source=bld.bldnode.find_or_declare('another.txt'),
|
||||||
|
target='another_copied.txt',
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
You can also establish the dependency directly on a task object::
|
||||||
|
|
||||||
@feature('myfeature')
|
@feature('myfeature')
|
||||||
def process_myfeature(self):
|
def process_myfeature(self):
|
||||||
baz_taskgen = self.bld.get_tgen_by_name('baz')
|
baz_taskgen = self.bld.get_tgen_by_name('baz')
|
||||||
|
Loading…
Reference in New Issue
Block a user