From 661549ecb7a9b136d72a01c137d9776c75d52d51 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Wed, 27 Sep 2023 22:46:20 +0300 Subject: CMake: Create liblzma.def when building liblzma.dll with MinGW-w64. --- cmake/remove-ordinals.cmake | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 cmake/remove-ordinals.cmake (limited to 'cmake/remove-ordinals.cmake') diff --git a/cmake/remove-ordinals.cmake b/cmake/remove-ordinals.cmake new file mode 100644 index 00000000..96419d52 --- /dev/null +++ b/cmake/remove-ordinals.cmake @@ -0,0 +1,26 @@ +############################################################################# +# +# remove-ordinals.cmake +# +# Removes the ordinal numbers from a DEF file that has been created by +# GNU ld or LLVM lld option --output-def (when creating a Windows DLL). +# This should be equivalent: sed 's/ \+@ *[0-9]\+//' +# +# Usage: +# +# cmake -DINPUT_FILE=infile.def.in \ +# -DOUTPUT_FILE=outfile.def \ +# -P remove-ordinals.cmake +# +############################################################################# +# +# Author: Lasse Collin +# +# This file has been put into the public domain. +# You can do whatever you want with this file. +# +############################################################################# + +file(READ "${INPUT_FILE}" STR) +string(REGEX REPLACE " +@ *[0-9]+" "" STR "${STR}") +file(WRITE "${OUTPUT_FILE}" "${STR}") -- cgit v1.2.3