diff options
| author | ruki <[email protected]> | 2022-08-01 22:33:41 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-08-01 22:33:41 +0800 |
| commit | edeadc165a26f1b5cc420e732eacc13a487c989e (patch) | |
| tree | 108a8ce8af907ed7774228df539f6d98d1ed8d41 /xmake/modules/private/cache/build_cache.lua | |
| parent | 31287e9e385b1c6523ef95e828a05eb78abf4f18 (diff) | |
fix cached object file mtime
Diffstat (limited to 'xmake/modules/private/cache/build_cache.lua')
| -rw-r--r-- | xmake/modules/private/cache/build_cache.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xmake/modules/private/cache/build_cache.lua b/xmake/modules/private/cache/build_cache.lua index 9954e2986..4cb1be5ca 100644 --- a/xmake/modules/private/cache/build_cache.lua +++ b/xmake/modules/private/cache/build_cache.lua @@ -183,9 +183,6 @@ function put(cachekey, objectfile, extrainfo) local objectfile_cached = path.join(rootdir(), cachekey:sub(1, 2):lower(), cachekey) local objectfile_infofile = objectfile_cached .. ".txt" os.cp(objectfile, objectfile_cached) - -- we need update mtime for incremental compilation - -- @see https://github.com/xmake-io/xmake/issues/2620 - os.touch(objectfile_cached, {mtime = os.time()}) if extrainfo then io.save(objectfile_infofile, extrainfo) end @@ -235,6 +232,9 @@ function build(program, argv, opt) local objectfile_cached, objectfile_infofile = get(cachekey) if objectfile_cached then os.cp(objectfile_cached, cppinfo.objectfile) + -- we need update mtime for incremental compilation + -- @see https://github.com/xmake-io/xmake/issues/2620 + os.touch(cppinfo.objectfile, {mtime = os.time()}) -- we need get outdata/errdata to show warnings, -- @see https://github.com/xmake-io/xmake/issues/2452 if objectfile_infofile and os.isfile(objectfile_infofile) then |
