diff options
| author | ruki <[email protected]> | 2022-07-28 00:54:22 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-07-28 00:54:22 +0800 |
| commit | 05a528a99571b8af8c0c5a84be9e51d8e7b982e6 (patch) | |
| tree | 3026b95a33d96de77232b8eef6d06ffbd04646f6 | |
| parent | fcaff26e625dad6fe73a2a69a46346851afdd3fd (diff) | |
disable fdirectives-only
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | xmake/core/project/policy.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/core/tools/gcc.lua | 9 |
3 files changed, 8 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index d6b717783..00df5daf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ * [#2576](https://github.com/xmake-io/xmake/issues/2576): More flexible package fetching from cmake * [#2577](https://github.com/xmake-io/xmake/issues/2577): Improve add_headerfiles(), add `{install = false}` support +* [#2603](https://github.com/xmake-io/xmake/issues/2603): Disable `-fdirectives-only` for ccache by default ## v2.6.9 @@ -1355,6 +1356,7 @@ * [#2576](https://github.com/xmake-io/xmake/issues/2576): More flexible package fetching from cmake * [#2577](https://github.com/xmake-io/xmake/issues/2577): 改进 add_headerfiles(),增加 `{install = false}` 支持 +* [#2603](https://github.com/xmake-io/xmake/issues/2603): 为 ccache 默认禁用 `-fdirectives-only` ## v2.6.9 diff --git a/xmake/core/project/policy.lua b/xmake/core/project/policy.lua index ed2fd42de..27d0b9d6a 100644 --- a/xmake/core/project/policy.lua +++ b/xmake/core/project/policy.lua @@ -54,7 +54,7 @@ function policy.policies() -- preprocessor configuration for ccache/distcc, we can disable linemarkers to speed up preprocess ["preprocessor.linemarkers"] = {description = "Enable linemarkers for preprocessor.", default = true, type = "boolean"}, -- preprocessor configuration for ccache/distcc, we can disable it to avoid cache object file with __DATE__, __TIME__ - ["preprocessor.gcc.directives_only"] = {description = "Enable -fdirectives-only for gcc preprocessor.", default = true, type = "boolean"}, + ["preprocessor.gcc.directives_only"] = {description = "Enable -fdirectives-only for gcc preprocessor.", type = "boolean"}, -- we need enable longpaths when building target or installing package ["platform.longpaths"] = {description = "Enable long paths when building target or installing package on windows.", default = false, type = "boolean"}, -- lock required packages diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index 0a1bc08e8..3906e5c48 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -416,15 +416,16 @@ function _preprocess(program, argv, opt) end end - -- enable "-fdirectives-only"? + -- enable "-fdirectives-only"? we need enable it manually + -- + -- @see https://github.com/xmake-io/xmake/issues/2603 + -- https://github.com/xmake-io/xmake/issues/2425 local directives_only if is_gcc then local cachekey = "core.tools." .. tool:name() directives_only = memcache.get(cachekey, "directives_only") if directives_only == nil then - if os.isfile(os.projectfile()) and project.policy("preprocessor.gcc.directives_only") == false then - directives_only = false - else + if os.isfile(os.projectfile()) and project.policy("preprocessor.gcc.directives_only") then directives_only = true end memcache.set(cachekey, "directives_only", directives_only) |
