mirror of
https://gitlab.com/ita1024/waf.git
synced 2025-01-07 17:05:17 +01:00
Make it easier to declare asm or preprocessed outputs to c/c++ tasks
The following can be used to add asm outputs to a c++ task (gcc): from waflib import Task from waflib.TaskGen import feature, after_method @feature('cxx') @after_method('process_source') def add_asm_outputs(self): for tsk in self.compiled_tasks: node2 = tsk.outputs[0].change_ext('.s') tsk.env.append_value('CXXFLAGS', '-Wa,-adhln=%s' % node2.abspath()) tsk.outputs.append(node2)
This commit is contained in:
parent
11180ae9f6
commit
0cd060c394
@ -17,7 +17,7 @@ def c_hook(self, node):
|
||||
|
||||
class c(Task.Task):
|
||||
"Compile C files into object files"
|
||||
run_str = '${CC} ${ARCH_ST:ARCH} ${CFLAGS} ${CPPFLAGS} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${CC_SRC_F}${SRC} ${CC_TGT_F}${TGT}'
|
||||
run_str = '${CC} ${ARCH_ST:ARCH} ${CFLAGS} ${CPPFLAGS} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${CC_SRC_F}${SRC} ${CC_TGT_F}${TGT[0].abspath()}'
|
||||
vars = ['CCDEPS'] # unused variable to depend on, just in case
|
||||
ext_in = ['.h'] # set the build order easily by using ext_out=['.h']
|
||||
scan = c_preproc.scan
|
||||
|
@ -18,7 +18,7 @@ if not '.c' in TaskGen.task_gen.mappings:
|
||||
|
||||
class cxx(Task.Task):
|
||||
"Compile C++ files into object files"
|
||||
run_str = '${CXX} ${ARCH_ST:ARCH} ${CXXFLAGS} ${CPPFLAGS} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${CXX_SRC_F}${SRC} ${CXX_TGT_F}${TGT}'
|
||||
run_str = '${CXX} ${ARCH_ST:ARCH} ${CXXFLAGS} ${CPPFLAGS} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${CXX_SRC_F}${SRC} ${CXX_TGT_F}${TGT[0].abspath()}'
|
||||
vars = ['CXXDEPS'] # unused variable to depend on, just in case
|
||||
ext_in = ['.h'] # set the build order easily by using ext_out=['.h']
|
||||
scan = c_preproc.scan
|
||||
|
Loading…
Reference in New Issue
Block a user