diff options
Diffstat (limited to 'xmake/modules/private/cache/build_cache.lua')
| -rw-r--r-- | xmake/modules/private/cache/build_cache.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/xmake/modules/private/cache/build_cache.lua b/xmake/modules/private/cache/build_cache.lua index 91bdb20e5..5c5f9d0a6 100644 --- a/xmake/modules/private/cache/build_cache.lua +++ b/xmake/modules/private/cache/build_cache.lua @@ -292,6 +292,8 @@ function build(program, argv, opt) _g.cache_hit_total_time = (_g.cache_hit_total_time or 0) + (os.mclock() - cache_hit_start_time) else -- do compile + local preprocess_outdata = cppinfo.outdata + local preprocess_errdata = cppinfo.errdata local compile_start_time = os.mclock() local compile_fallback = opt.compile_fallback if compile_fallback then @@ -307,6 +309,13 @@ function build(program, argv, opt) else compile(program, cppinfo, opt) end + -- if no compiler output, we need use preprocessor output, because it maybe contains warning output + if not cppinfo.outdata or #cppinfo.outdata == 0 then + cppinfo.outdata = preprocess_outdata + end + if not cppinfo.errdata or #cppinfo.errdata == 0 then + cppinfo.errdata = preprocess_errdata + end _g.compile_total_time = (_g.compile_total_time or 0) + (os.mclock() - compile_start_time) if cachekey then local extrainfo |
