diff options
| author | ruki <[email protected]> | 2024-01-26 23:11:48 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-01-26 23:11:48 +0800 |
| commit | 042362f4c3f1dab8b6b5a32fcbbae20e66e224de (patch) | |
| tree | 36b7258e09286384384f66108ae27728e661ab63 /xmake/modules/private/cache/build_cache.lua | |
| parent | d3a86e72f8954982d8817de1f1a65f34b14b24f6 (diff) | |
fix preprocessor output
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 |
