From 4e3e21fc01de3ec1f0184de2fbae254f985fbc2d Mon Sep 17 00:00:00 2001 From: xavi92 Date: Sun, 27 Oct 2024 07:55:04 +0000 Subject: [PATCH] 3rdParty-devel: Patch .def files for vorbis Even if the library name on the "LIBRARY" directive from a .def file is defined as optional according to the specification [1], MinGW requires it anyway. Otherwise, the linker would throw the following error message: .def: file format not recognized; treating as linker script Even if this had been already reported as an issue many years ago [2], it can still be reproduced on x86_64-w64-mingw32-ld-win32 2.43. [1]: http://msdn2.microsoft.com/en-us/library/30fw19zw [2]: https://lists.gnu.org/archive/html/bug-binutils/2006-03/msg00147.html git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9584 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 5dd3ccdc7d18670008698ea22820d357c7ec362c Former-commit-id: 4647af42a658582de0c01115ec9a345af43300b5 --- packaging/3rdParty-devel/CMakeLists.txt | 21 +++++++++++++++++++ .../3rdParty-devel/patches/vorbis/vorbis.def | 2 +- .../patches/vorbis/vorbisenc.def | 2 +- .../patches/vorbis/vorbisfile.def | 2 +- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/packaging/3rdParty-devel/CMakeLists.txt b/packaging/3rdParty-devel/CMakeLists.txt index a1628d2c0..795ef9433 100644 --- a/packaging/3rdParty-devel/CMakeLists.txt +++ b/packaging/3rdParty-devel/CMakeLists.txt @@ -369,6 +369,27 @@ if(OPTION_VORBIS) URL_HASH ${VORBIS_HASH} CMAKE_ARGS ${VORBIS_ARGS} DEPENDS ${OGG_PROJECT}) + + ExternalProject_Add_Step(${VORBIS_PROJECT} vorbis_patch_def + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_SOURCE_DIR}/patches/vorbis/vorbis.def" + "/win32/vorbis.def" + DEPENDEES update # do after update + DEPENDERS patch) # do before patch + + ExternalProject_Add_Step(${VORBIS_PROJECT} vorbis_patch_enc_def + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_SOURCE_DIR}/patches/vorbis/vorbisenc.def" + "/win32/vorbisenc.def" + DEPENDEES update # do after update + DEPENDERS patch) # do before patch + + ExternalProject_Add_Step(${VORBIS_PROJECT} vorbis_patch_file_def + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_SOURCE_DIR}/patches/vorbis/vorbisfile.def" + "/win32/vorbisfile.def" + DEPENDEES update # do after update + DEPENDERS patch) # do before patch else() set(VORBIS_PROJECT ) endif() diff --git a/packaging/3rdParty-devel/patches/vorbis/vorbis.def b/packaging/3rdParty-devel/patches/vorbis/vorbis.def index 884f8f023..beb2e5e5d 100644 --- a/packaging/3rdParty-devel/patches/vorbis/vorbis.def +++ b/packaging/3rdParty-devel/patches/vorbis/vorbis.def @@ -1,6 +1,6 @@ ; vorbis.def ; -LIBRARY +LIBRARY libvorbis.dll EXPORTS _floor_P _mapping_P diff --git a/packaging/3rdParty-devel/patches/vorbis/vorbisenc.def b/packaging/3rdParty-devel/patches/vorbis/vorbisenc.def index 79af06440..72528a1c0 100644 --- a/packaging/3rdParty-devel/patches/vorbis/vorbisenc.def +++ b/packaging/3rdParty-devel/patches/vorbis/vorbisenc.def @@ -1,6 +1,6 @@ ; vorbisenc.def ; -LIBRARY +LIBRARY libvorbisenc.dll EXPORTS vorbis_encode_init diff --git a/packaging/3rdParty-devel/patches/vorbis/vorbisfile.def b/packaging/3rdParty-devel/patches/vorbis/vorbisfile.def index 4dc554962..2bab31517 100644 --- a/packaging/3rdParty-devel/patches/vorbis/vorbisfile.def +++ b/packaging/3rdParty-devel/patches/vorbis/vorbisfile.def @@ -1,6 +1,6 @@ ; vorbisfile.def ; -LIBRARY +LIBRARY libvorbisfile.dll EXPORTS ov_clear ov_open