Commit 696cb02d authored by Martin Storsjö's avatar Martin Storsjö

contrib: x265: Patch x265 to skip the resource file

CMake uses a static library to pass files to the linker. CMake
does request windres to produce a COFF formatted object file, but
llvm-mingw's windres wrapper currently overrides it and produces
a .res (arch independent) formatted one instead. LLD doesn't support
such files in static libraries.

Just don't bother with the resource file for now, it's irrelevant
from VLC's point of view - it's only used for the executable and
shared library, neither of which are used by VLC.

Passing -DCMAKE_RC_COMPILER=FALSE on the cmake configuration line
sounds like a different workaround, but that doesn't seem to work
though - then we suddenly start getting -fPIC flags to the compiler,
which clang errors out on.

This can be dropped once llvm-mingw doesn't need to force the
windres output into the arch independent format.
parent 28a96b9b
......@@ -27,6 +27,7 @@ x265: x265-$(X265_VERSION).tar.bz2 .sum-x265
mkdir -p $@-$(X265_VERSION)
tar xvjf "$<" --strip-components=1 -C $@-$(X265_VERSION)
$(APPLY) $(SRC)/x265/x265-ldl-linking.patch
$(APPLY) $(SRC)/x265/win-skip-res.patch
$(call pkg_static,"source/x265.pc.in")
ifndef HAVE_WIN32
$(APPLY) $(SRC)/x265/x265-pkg-libs.patch
......
diff -urN x265-orig/source/CMakeLists.txt x265/source/CMakeLists.txt
--- x265-orig/source/CMakeLists.txt 2017-12-14 10:04:53.932080387 +0000
+++ x265/source/CMakeLists.txt 2017-12-14 10:05:35.151167937 +0000
@@ -441,7 +441,7 @@
ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
install(FILES x265.h "${PROJECT_BINARY_DIR}/x265_config.h" DESTINATION include)
-if(CMAKE_RC_COMPILER)
+if(FALSE)
# The resource compiler does not need CFLAGS or macro defines. It
# often breaks them
string(REPLACE "<FLAGS>" "" CMAKE_RC_COMPILE_OBJECT "${CMAKE_RC_COMPILE_OBJECT}")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment