diff options
| author | ruki <[email protected]> | 2026-01-24 22:16:41 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-01-24 22:16:41 +0800 |
| commit | 1532bf0e2acfe769c2545b3d3d4f35ed5556de24 (patch) | |
| tree | 5a64958362eb217c35e4034c73db74925bd95bd0 /xmake/rules/c++/precompiled_header/xmake.lua | |
| parent | 5ed27569ffb41d7ce65a9185e26ad258bd2707fd (diff) | |
improve pch rules
Diffstat (limited to 'xmake/rules/c++/precompiled_header/xmake.lua')
| -rw-r--r-- | xmake/rules/c++/precompiled_header/xmake.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xmake/rules/c++/precompiled_header/xmake.lua b/xmake/rules/c++/precompiled_header/xmake.lua index d67535cc6..8bfdd09dd 100644 --- a/xmake/rules/c++/precompiled_header/xmake.lua +++ b/xmake/rules/c++/precompiled_header/xmake.lua @@ -20,7 +20,10 @@ rule("c.build.pcheader") on_config(function (target, opt) - import("private.action.build.pcheader").config(target, "c", opt) + import("private.action.build.pcheader") + if not pcheader.config(target, "c", opt) then + target:rule_enable("c.build.pcheader", false) + end end) before_build(function (target, jobgraph, opt) @@ -31,7 +34,10 @@ rule("c.build.pcheader") rule("c++.build.pcheader") on_config(function (target, opt) - import("private.action.build.pcheader").config(target, "cxx", opt) + import("private.action.build.pcheader") + if not pcheader.config(target, "cxx", opt) then + target:rule_enable("c++.build.pcheader", false) + end end) -- If the current target has a C++ modules file, |
