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
This commit is contained in:
xavi92 2024-10-27 07:55:04 +00:00
parent fcc3ce9428
commit 4e3e21fc01
4 changed files with 24 additions and 3 deletions

View file

@ -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"
"<SOURCE_DIR>/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"
"<SOURCE_DIR>/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"
"<SOURCE_DIR>/win32/vorbisfile.def"
DEPENDEES update # do after update
DEPENDERS patch) # do before patch
else()
set(VORBIS_PROJECT )
endif()

View file

@ -1,6 +1,6 @@
; vorbis.def
;
LIBRARY
LIBRARY libvorbis.dll
EXPORTS
_floor_P
_mapping_P

View file

@ -1,6 +1,6 @@
; vorbisenc.def
;
LIBRARY
LIBRARY libvorbisenc.dll
EXPORTS
vorbis_encode_init

View file

@ -1,6 +1,6 @@
; vorbisfile.def
;
LIBRARY
LIBRARY libvorbisfile.dll
EXPORTS
ov_clear
ov_open