Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt工程添加预编译头文件后,生成CMake工程moc文件编译报错 #4886

Closed
supf1994 opened this issue Mar 27, 2024 · 6 comments
Closed
Labels
Milestone

Comments

@supf1994
Copy link

Xmake 版本

2.8.9

操作系统版本和架构

windows10

描述问题

Qt工程添加预编译头文件后,使用xmake project_test -k cmake 生成CMake工程moc文件编译报错
project_test 插件修复了 #4884 问题
生成cmake文件后,使用QtCreator打开,编译时报如下错误
image

似乎是预编译头文件还未生成时就先生成moc文件并编译,导致该错误

测试工程
qt_test.zip

期待的结果

...

工程配置

...

附加信息和错误日志

...

@supf1994 supf1994 added the bug label Mar 27, 2024
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: After adding the precompiled header file to the Qt project, a compilation error is reported when generating the CMake project moc file.

Xmake version

2.8.9

Operating system version and architecture

windows10

Describe the problem

After adding the precompiled header file to the Qt project, use xmake project_test -k cmake to generate the CMake project moc file and compile the error
The project_test plugin fixes issue #4884
After generating the cmake file, use QtCreator to open it, and the following error will be reported during compilation.
image

It seems that the moc file is generated and compiled before the precompiled header file is generated, causing this error.

test engineering
qt_test.zip

Expected results

...

Project configuration

...

Additional information and error logs

...

@waruqi
Copy link
Member

waruqi commented Mar 27, 2024

试下这个 patch #4888

xmake update -s dev

@waruqi waruqi added this to the v2.9.1 milestone Mar 27, 2024
@supf1994
Copy link
Author

试下这个 patch #4888

xmake update -s dev

可以解决这个问题,不过正式的工程中,依然有部分带路径的cl参数里出现了 \

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Try this patch #4888

xmake update -s dev

This problem can be solved, but in the official project, there are still some cl parameters with paths where \

@waruqi
Copy link
Member

waruqi commented Mar 28, 2024

既然这里解决,我就关了,有其他问题,再开 issues

@waruqi waruqi closed this as completed Mar 28, 2024
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Since it is solved here, I will close it. If there are other problems, I will open issues again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants