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

cmake和configure file设置错误导致parser_header.h生成错误 #434

Open
LonelyQuantum opened this issue Feb 19, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@LonelyQuantum
Copy link

Describe the bug | Bug描述
build/parser_header.h 中 runtime的最后一个头文件和editor的第一个头文件inlcude时混杂在了一起,并且出现额外的逗号,如下所示

...
#include  "C:/path/to/engine/Piccolo/engine/source/runtime/resource/res_type/global/global_particle.h"
#include  "C:/path/to/engine/Piccolo/engine/source/runtime/resource/res_type/global/global_rendering.h,“C:/path/to/engine/Piccolo/engine/source/editor/include/axis.h"
#include  "C:/path/to/engine/Piccolo/engine/source/editor/include/editor.h"
...

Steps to reproduce | 如何复现
生成PiccoloEditor项目即可

解决办法
engine/source/editor/CMakeLists.txt 的第48行(最后一行)
set(PICCOLO_EDITOR_HEADS “${EDITOR_HEADERS}” PARENT_SCOPE)
改为
set(PICCOLO_EDITOR_HEADS ${EDITOR_HEADERS} PARENT_SCOPE)
去掉双引号。

同时将 engine/source/precompile/precompile.json.in 第一行
@PICCOLO_RUNTIME_HEADS@,@PICCOLO_EDITOR_HEADS@
改为
@PICCOLO_RUNTIME_HEADS@;@PICCOLO_EDITOR_HEADS@

这样才能让engine/source/precompile/precompile.cmake第5行configure_file(${PICCOLO_PRECOMPILE_PARAMS_IN_PATH} ${PICCOLO_PRECOMPILE_PARAMS_PATH}) 生成的engine/bin/precompile.json文件中的头文件名均被';'分隔开,得以被engine/source/meta_parser/parser/parser.cpp中的MetaParser::parseProject()正确解析。该函数在文件第101行解析include_files时采用的';'分隔。

修改后生成的build/parser_header.h文件中对应位置变为

...
#include  "C:/path/to/engine/Piccolo/engine/source/runtime/resource/res_type/global/global_particle.h"
#include  "C:/path/to/engine/Piccolo/engine/source/runtime/resource/res_type/global/global_rendering.h“
#include  “C:/path/to/engine/Piccolo/engine/source/editor/include/axis.h"
#include  "C:/path/to/engine/Piccolo/engine/source/editor/include/editor.h"
...
@LonelyQuantum LonelyQuantum added the bug Something isn't working label Feb 19, 2023
@LonelyQuantum LonelyQuantum changed the title cmake和configure file设置错误导致parser_header.h错误 cmake和configure file设置错误导致parser_header.h生成错误 Feb 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant