qmake:额外的编译器(处理步骤)? [英] qmake: extra compilers (processing steps)?

查看:176
本文介绍了qmake:额外的编译器(处理步骤)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的基于qmake的项目中,我想在编译之前对一些文件运行xxd。在文档之后,我的pro文件中的相关部分如下:

  SHADERS = shader / tone.frag \ 
shader / trans.frag \
shader / hue.frag

#xxd
xxd.output = $ {QMAKE_FILE_NAME} .xxd
xxd.commands = xxd -i $ {QMAKE_FILE_NAME}> $ {QMAKE_FILE_OUT}
xxd.depends = SHADERS
xxd.input = $$ SHADERS
xxd.variable_out = HEADERS

QMAKE_EXTRA_COMPILERS + = xxd

Qmake不抱怨,但它也不运行xxd。我必须为我想要预处理的每个文件创建特殊目标吗?



编辑:

/ strong>使用smokris的帮助,这是我如何修正在我的pro文件中的部分:

 #xxd 
xxd .output = $ {QMAKE_FILE_NAME} .xxd
xxd.commands = xxd -i $ {QMAKE_FILE_NAME}> $ {QMAKE_FILE_OUT}
xxd.depends = $$ SHADERS
xxd.input = SHADERS
xxd.variable_out = HEADERS


解决方案

.input 属性期望变量的名称,文件。尝试取走 $$ ,只需使用 xxd.input = SHADERS


$另一方面,需要一个文件列表,所以使用 xxd.depends = $$ SHADERS

code>。



如果将 .variable_out 设置为 HEADERS SOURCES OBJECTS ,编译器将运行。但是,如果将 .variable_out 设置为另一个变量名,则还必须设置 .CONFIG = target_predeps 编译器运行。


In my qmake-based project, I want to run 'xxd' on some files before compilation. Following the documentation, the relevant part in my pro file looks as following:

SHADERS = shader/tone.frag \
          shader/trans.frag \
          shader/hue.frag

# xxd
xxd.output = ${QMAKE_FILE_NAME}.xxd
xxd.commands = xxd -i ${QMAKE_FILE_NAME} > ${QMAKE_FILE_OUT}
xxd.depends = SHADERS
xxd.input = $$SHADERS
xxd.variable_out = HEADERS

QMAKE_EXTRA_COMPILERS += xxd

Qmake doesn't complain, but it also doesn't run xxd at all. Do I have to create special targets for each file I want to have pre-processed? (The resulting *.xxd files will not be compiled afterwards by me, only included in other cpp files)

Edit: With smokris's help, this is how I fixed the part in my pro file:

# xxd
xxd.output = ${QMAKE_FILE_NAME}.xxd
xxd.commands = xxd -i ${QMAKE_FILE_NAME} > ${QMAKE_FILE_OUT}
xxd.depends = $$SHADERS
xxd.input = SHADERS
xxd.variable_out = HEADERS

解决方案

The .input attribute expects the name of a variable, not a list of files. Try taking away the $$ and just use xxd.input = SHADERS.

.depends, on the other hand, expects a list of files, so use xxd.depends = $$SHADERS.

If you set .variable_out to HEADERS, SOURCES, or OBJECTS, the compiler will run. However, if you set .variable_out to another variable name, you must also set .CONFIG = target_predeps in order for the compiler to run.

这篇关于qmake:额外的编译器(处理步骤)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆