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

修复在IWYU模式下的编译报错问题 #1648

Merged
merged 2 commits into from
Jan 30, 2024

Conversation

BlurryLight
Copy link
Contributor

@BlurryLight BlurryLight commented Jan 30, 2024

见文档 Include What You Use,有一个强制要求是 .cpp对应的头文件 .h必须是第一个被包含的头文件。

JSEnv.Build.cs里没有指定是否用 PCHUsageMode.UseExplicitOrSharedPCHs,UBT会用当前工程的 XX.Target.cs里的配置,如果XX.Target.CS里指定了 BuildSettingsVersion ≥ V2的情况下会自动开启 IWYU模式。

另外一种可能改法是把 #if UE_5_3_OR_LATER这个宏去掉,但是不知道会不会引起其他问题。

    public JsEnv(ReadOnlyTargetRules Target) : base(Target)
    {
#if UE_5_3_OR_LATER
        PCHUsage = PCHUsageMode.NoPCHs;
#endif

@chexiongsheng chexiongsheng merged commit bd5cae3 into Tencent:master Jan 30, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants