[PATCH] D56781: Use response file when generating LLVM-C.dll
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 22 08:25:37 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL351833: Use response file when generating LLVM-C.dll (authored by serge_sans_paille, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D56781?vs=182233&id=182926#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56781/new/
https://reviews.llvm.org/D56781
Files:
llvm/trunk/tools/llvm-shlib/CMakeLists.txt
llvm/trunk/tools/llvm-shlib/gen-msvc-exports.py
Index: llvm/trunk/tools/llvm-shlib/CMakeLists.txt
===================================================================
--- llvm/trunk/tools/llvm-shlib/CMakeLists.txt
+++ llvm/trunk/tools/llvm-shlib/CMakeLists.txt
@@ -137,13 +137,20 @@
list(APPEND FULL_LIB_NAMES ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib/${lib}.lib)
endforeach()
+ # Need to seperate lib names with newlines.
+ string(REPLACE ";" "\n" FILE_CONTENT "${FULL_LIB_NAMES}")
+
+ # Write out the full lib names into file to be read by the python script.
+ set(LIBSFILE ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/libllvm-c.args)
+ file(WRITE ${LIBSFILE} "${FILE_CONTENT}")
+
# Generate the exports file dynamically.
set(GEN_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/gen-msvc-exports.py)
set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/libllvm-c.exports)
add_custom_command(OUTPUT ${LLVM_EXPORTED_SYMBOL_FILE}
- COMMAND ${PYTHON_EXECUTABLE} ${GEN_SCRIPT} ${FULL_LIB_NAMES} ${GEN_UNDERSCORE} --nm ${LLVM_TOOLS_BINARY_DIR}/llvm-nm -o ${LLVM_EXPORTED_SYMBOL_FILE}
+ COMMAND ${PYTHON_EXECUTABLE} ${GEN_SCRIPT} --libsfile ${LIBSFILE} ${GEN_UNDERSCORE} --nm ${LLVM_TOOLS_BINARY_DIR}/llvm-nm -o ${LLVM_EXPORTED_SYMBOL_FILE}
DEPENDS ${LIB_NAMES} llvm-nm
COMMENT "Generating export list for LLVM-C"
VERBATIM )
Index: llvm/trunk/tools/llvm-shlib/gen-msvc-exports.py
===================================================================
--- llvm/trunk/tools/llvm-shlib/gen-msvc-exports.py
+++ llvm/trunk/tools/llvm-shlib/gen-msvc-exports.py
@@ -83,6 +83,10 @@
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'
)
parser.add_argument('-u', '--underscore',
@@ -93,12 +97,19 @@
'--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__':
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56781.182926.patch
Type: text/x-patch
Size: 2640 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190122/d2f460a0/attachment.bin>
More information about the llvm-commits
mailing list