Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix builds with system LZMA when using versions of CMake before 3.14 #9025

Merged
merged 1 commit into from Oct 20, 2020

Conversation

cyrozap
Copy link
Contributor

@cyrozap cyrozap commented Aug 11, 2020

The "FindLibLZMA.cmake" module in CMake versions prior to 3.14 do not
set an alias like how "Externals/liblzma/CMakeLists.txt" does, so builds
performed using one of those older CMake versions will fail if the
system LZMA library is detected. To fix this, we need to link against
"lzma" instead of "LibLZMA::LibLZMA".

This is an update of #9017, with the zstd build changes removed and the commit message altered to make it more clear what problem it's fixing.

This patch is needed to fix builds on Debian 10 (buster).

The "FindLibLZMA.cmake" module in CMake versions prior to 3.14 do not
set an alias like how Externals/liblzma/CMakeLists.txt does, so builds
performed using one of those older CMake versions will fail if the
system LZMA library is detected. To fix this, we need to link against
"lzma" instead of "LibLZMA::LibLZMA".

Fixes: b59ef81 ("WIA: Implement bzip2, LZMA, and LZMA2 decompression")
@orbea
Copy link
Contributor

orbea commented Sep 9, 2020

Seems to work for cmake-3.18.2 too.

-- Looking for lzma_auto_decoder in /usr/lib64/liblzma.so
-- Looking for lzma_auto_decoder in /usr/lib64/liblzma.so - found
-- Looking for lzma_easy_encoder in /usr/lib64/liblzma.so
-- Looking for lzma_easy_encoder in /usr/lib64/liblzma.so - found
-- Looking for lzma_lzma_preset in /usr/lib64/liblzma.so
-- Looking for lzma_lzma_preset in /usr/lib64/liblzma.so - found
-- Found LibLZMA: /usr/lib64/liblzma.so (found version "5.2.5") 
-- Looking for lzma.h
-- Looking for lzma.h - found
-- Using shared lzma
$ ldd Binaries/dolphin-emu | grep -i lzma
	liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f089f480000)

@leoetlino leoetlino merged commit 70ab3bf into dolphin-emu:master Oct 20, 2020
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants