From d2f2f33ef2d071ba535e57b1637ebd9cc3206d51 Mon Sep 17 00:00:00 2001 From: Serge Guelton Date: Tue, 19 Mar 2019 09:14:09 +0000 Subject: Use response file when generating LLVM-C.dll As discovered in D56774 the command line gets to long, so use a response file to give the script the libs. This change has been tested and is confirmed working for me. Commited on behalf of Jakob Bornecrantz. Differential Revision: https://reviews.llvm.org/D56781 llvm-svn: 356443 --- llvm/tools/llvm-shlib/gen-msvc-exports.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'llvm/tools/llvm-shlib/gen-msvc-exports.py') diff --git a/llvm/tools/llvm-shlib/gen-msvc-exports.py b/llvm/tools/llvm-shlib/gen-msvc-exports.py index 2b7291de28b..671faf11528 100644 --- a/llvm/tools/llvm-shlib/gen-msvc-exports.py +++ b/llvm/tools/llvm-shlib/gen-msvc-exports.py @@ -82,6 +82,10 @@ def gen_llvm_c_export(output, underscore, libs, nm): def main(): parser = argparse.ArgumentParser('gen-msvc-exports') + parser.add_argument( + '-i', '--libsfile', help='file with list of libs, new line separated', + action='store', default=None + ) parser.add_argument( '-o', '--output', help='output filename', default='LLVM-C.exports' ) @@ -93,12 +97,19 @@ def main(): '--nm', help='path to the llvm-nm executable', default='llvm-nm' ) parser.add_argument( - 'libs', metavar='LIBS', nargs='+', help='list of libraries to generate export from' + 'libs', metavar='LIBS', nargs='*', help='list of libraries to generate export from' ) ns = parser.parse_args() - gen_llvm_c_export(ns.output, ns.underscore, ns.libs, ns.nm) + libs = ns.libs + + # Add if we where given a libsfile add it to the libs. + if ns.libsfile: + with open(ns.libsfile) as f: + libs.extend(f.read().splitlines()) + + gen_llvm_c_export(ns.output, ns.underscore, libs, ns.nm) if __name__ == '__main__': -- cgit v1.2.3