From 38d0f85deb49737763796b85e2a0c602a5a72119 Mon Sep 17 00:00:00 2001 From: vvb2060 Date: Fri, 18 Dec 2020 08:05:02 +0800 Subject: [PATCH] Avoid unnecessary builds --- build.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index 259635ed2..aaf3f9c20 100755 --- a/build.py +++ b/build.py @@ -297,7 +297,10 @@ def build_binary(args): header('* Building binaries: ' + ' '.join(args.target)) - os.utime(op.join('native', 'jni', 'include', 'flags.hpp')) + config_stat = os.stat(args.config) + flags = op.join('native', 'jni', 'include', 'flags.hpp') + if config_stat.st_mtime_ns > os.stat(flags).st_mtime_ns: + os.utime(flags, ns=(config_stat.st_atime_ns, config_stat.st_mtime_ns)) # Basic flags global base_flags