Chromium Code Reviews| Index: pylib/gyp/mac_tool.py |
| =================================================================== |
| --- pylib/gyp/mac_tool.py (revision 2014) |
| +++ pylib/gyp/mac_tool.py (working copy) |
| @@ -223,11 +223,29 @@ |
| r'^.*libtool: warning for library: ' + |
| r'.* the table of contents is empty ' + |
| r'\(no object file members in the library define global symbols\)$') |
| - libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE) |
| + env = os.environ.copy() |
| + # Ref: |
| + # http://www.opensource.apple.com/source/cctools/cctools-809/misc/libtool.c |
| + # The problem with this flag is that it resets the file mtime on the file to |
| + # epoch=0, e.g. 1970-1-1 or 1969-12-31 depending on daylight saving. |
|
M-A Ruel
2014/12/11 00:41:35
actually, s/daylight saving/timezone/
Sébastien Marchand
2014/12/11 18:37:45
Done.
|
| + # |
| + # We disable this for iOS as this cause a rebuild of all the library files. |
| + is_ios_target = 'IPHONEOS_DEPLOYMENT_TARGET' in os.environ |
| + if not is_ios_target: |
| + env['ZERO_AR_DATE'] = '1' |
| + libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE, env=env) |
| _, err = libtoolout.communicate() |
| for line in err.splitlines(): |
| if not libtool_re.match(line) and not libtool_re5.match(line): |
| print >>sys.stderr, line |
| + # Unconditionally touch any file .a file on the command line if present if |
| + # succeeded. A bit hacky. |
| + if not is_ios_target and not libtoolout.returncode: |
| + archives = [ |
| + cmd for cmd in cmd_list if cmd.endswith('.a') and os.path.isfile(cmd) |
| + ] |
| + if len(archives) == 1: |
| + os.utime(archives[0], None) |
| return libtoolout.returncode |
| def ExecPackageFramework(self, framework, version): |