diff options
| -rw-r--r-- | xmake/modules/core/tools/gcc.lua | 3 | ||||
| -rw-r--r-- | xmake/modules/private/cache/build_cache.lua | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index 93674a702..eb1f396dc 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -528,8 +528,7 @@ function _preprocess(program, argv, opt) local cppinfo = try {function () local outdata, errdata = os.iorunv(program, cppflags, opt) return {outdata = outdata, errdata = errdata, - sourcefile = sourcefile, objectfile = objectfile, cppfile = cppfile, cppflags = flags, - directives_only = directives_only} + sourcefile = sourcefile, objectfile = objectfile, cppfile = cppfile, cppflags = flags} end} if not cppinfo then if is_gcc then diff --git a/xmake/modules/private/cache/build_cache.lua b/xmake/modules/private/cache/build_cache.lua index 882f50f9a..0d5dd02d4 100644 --- a/xmake/modules/private/cache/build_cache.lua +++ b/xmake/modules/private/cache/build_cache.lua @@ -68,10 +68,9 @@ end function cachekey(program, cppinfo, envs) local cppfile = cppinfo.cppfile local cppflags = cppinfo.cppflags - local directives_only = cppinfo.directives_only local items = {program} for _, cppflag in ipairs(cppflags) do - if not directives_only and (cppflag:startswith("-D") or cppflag:startswith("/D")) then + if cppflag:startswith("-D") or cppflag:startswith("/D") then -- ignore `-Dxx` to improve the cache hit rate, as some source files may not use the defined macros. -- @see https://github.com/xmake-io/xmake/issues/2425 else |
