Python SCON以什么顺序执行构建器?
我为预编译、编译、汇编和链接器编写了四个SCON构建器。我的意思是对编译后脚本使用预编译器输出,而其他三个构建器应该构建实际的可执行文件 如果我不使用预编译器,一切都会正常工作 如果我添加预编译器,SCons将调用预编译器,然后调用链接器。当然,没有对象文件,链接进程中断。 此外,预处理器的输出被放入为编译器输出指定的路径中,因此SCons忽略VariantDir()给出的输出路径 我试图以不同的顺序添加生成器,但似乎没有帮助。有什么想法吗Python SCON以什么顺序执行构建器?,python,build,scons,Python,Build,Scons,我为预编译、编译、汇编和链接器编写了四个SCON构建器。我的意思是对编译后脚本使用预编译器输出,而其他三个构建器应该构建实际的可执行文件 如果我不使用预编译器,一切都会正常工作 如果我添加预编译器,SCons将调用预编译器,然后调用链接器。当然,没有对象文件,链接进程中断。 此外,预处理器的输出被放入为编译器输出指定的路径中,因此SCons忽略VariantDir()给出的输出路径 我试图以不同的顺序添加生成器,但似乎没有帮助。有什么想法吗 ------------- Preparser ---
------------- Preparser -------------------------
builders['preParser'] = Builder(action=Action(preParserCommand),
suffix=".i",
src_suffix=".c",
single_source=1)
currentOutputPath = "C:\\Users\\BLABLUB\\Desktop\\TMP"
tool['preParser'].VariantDir(currentOutputPath, os.path.relpath(ps.sourcePath), duplicate=0)
tool['preParser']["BUILDERS"] = {"run": builders['preParser']}
tool['preParser']["PLATFORM"] = currentTool["arch"]
tool['preParser']["PRINT_CMD_LINE_FUNC"] = print_cmd_line
tool['preParser'].Decider("MD5-timestamp")
------------- Compiler --------------------------
builders[key] = Builder(action=Action(currentCommands[key]["command"]),
suffix=currentCommands[key] ["suffix_target"],
src_suffix=currentCommands[key]["suffix_source"],
single_source=1)
tool[key].VariantDir(os.path.relpath(
outputPaths[key]), os.path.relpath(ps.sourcePath), duplicate=0)
tool[key]["BUILDERS"] = {"run": builders[key]}
tool[key]["PLATFORM"] = currentTool["arch"]
tool[key]["PRINT_CMD_LINE_FUNC"] = print_cmd_line
tool[key].Decider("MD5-timestamp")
continue
------------- Assembler ---------------------------------
...
# compile
targets += tool["compiler"].run(compFileList)
# precompile
targets += tool['preParser'].run(compFileList)
# disassemble
targets += tool["assembler"].run(assemFileList)
# link
finalTargetSuffix = currentCommands["linker"]["suffix_target"]
fTarget = tool["linker"].run(finalTarget + finalTargetSuffix, targets)
你能添加一个完整的简单的SConstruct来说明你的问题吗?没有更多的信息很难帮助你。你能添加一个完整的简单的说明来说明你的问题吗?没有更多的信息,很难帮助你。