dummy_libs.py (780B)
1 # This Source Code Form is subject to the terms of the Mozilla Public 2 # License, v. 2.0. If a copy of the MPL was not distributed with this 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 5 import os 6 import subprocess 7 8 from buildconfig import substs 9 10 11 def main(output, *other_libs): 12 output.close() 13 # ar doesn't like it when the file exists beforehand. 14 os.unlink(output.name) 15 libs = [output.name] 16 parent = os.path.dirname(output.name) 17 libs.extend(os.path.join(parent, l) for l in other_libs) 18 for lib in libs: 19 result = subprocess.run( 20 [substs["AR"]] + [f.replace("$@", lib) for f in substs["AR_FLAGS"]], 21 check=False, 22 ) 23 if result.returncode != 0: 24 return result.returncode 25 return 0