diff options
| -rw-r--r-- | xmake/modules/private/action/build/pcheader.lua | 3 | ||||
| -rw-r--r-- | xmake/rules/c++/precompiled_header/xmake.lua | 10 |
2 files changed, 11 insertions, 2 deletions
diff --git a/xmake/modules/private/action/build/pcheader.lua b/xmake/modules/private/action/build/pcheader.lua index 2e3210dca..4e984f62b 100644 --- a/xmake/modules/private/action/build/pcheader.lua +++ b/xmake/modules/private/action/build/pcheader.lua @@ -51,6 +51,9 @@ function config(target, langkind, opt) target:pcheaderfile_set(langkind, headerfile) end end + + -- enable precompiled header? + return true end end 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, |
