Skip to content

Commit a7ba84a

Browse files
committed
cmake: Inline the add_llvm_symbol_exports.py script
This fixes stand-alone builds. Reviewed By: andrewng Differential Revision: https://reviews.llvm.org/D137611
1 parent 1cb97a1 commit a7ba84a

File tree

2 files changed

+7
-27
lines changed

2 files changed

+7
-27
lines changed

llvm/cmake/modules/AddLLVM.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,13 @@ function(add_llvm_symbol_exports target_name export_file)
103103
# FIXME: Don't write the "local:" line on OpenBSD.
104104
# in the export file, also add a linker script to version LLVM symbols (form: LLVM_N.M)
105105
add_custom_command(OUTPUT ${native_export_file}
106-
COMMAND "${Python3_EXECUTABLE}" ${LLVM_MAIN_SRC_DIR}/utils/add_llvm_symbol_exports.py ${LLVM_VERSION_MAJOR} ${export_file} ${native_export_file}
106+
COMMAND "${Python3_EXECUTABLE}" "-c"
107+
"import sys; \
108+
lines = [' ' + l.rstrip() for l in sys.stdin] + [' local: *;']; \
109+
print('LLVM_${LLVM_VERSION_MAJOR} {'); \
110+
print(' global:') if len(lines) > 1 else None; \
111+
print(';\\n'.join(lines) + '\\n};')"
112+
< ${export_file} > ${native_export_file}
107113
DEPENDS ${export_file}
108114
VERBATIM
109115
COMMENT "Creating export file for ${target_name}")

llvm/utils/add_llvm_symbol_exports.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)