Hi Simon,
On Thu, Jul 05, 2018 at 03:34:33PM +0100, Simon McVittie wrote:
> The cmake build system passes -DCMAKE_INSTALL_LIBDIR=lib/MULTIARCH to
> cmake, but only when cross-compiling. This seems weird: the Autotools
> equivalent would be passing --libdir='${exec_prefix}/lib/MULTIARCH'
> but only when cross-compiling.
The weirdness is kinda intentional and due to cmake.
When cmake does a native build, it detects that we are building for
Debian and Debian loves multiarch, so cmake defaults to a multiarch
libdir.
When cmake does a cross build, it cannot tell whether we are building
for Debian or not. It knows we are building on Debian, but meh. So what
to do here? For sure if you are cross building, you're building for
something else, so better not use a multiarch libdir here.
At least that's the logic of cmake.
Thus we added the passing of this variable to fix cross build failures.
The equivalent in autotools would be to have a default --libdir that
depends on whether you are native building or cross building. I hope we
agree that that would be just as weird.
> I would have expected that for each compat level, cmake-built packages
> should have the same CMAKE_INSTALL_LIBDIR - either lib or lib/MULTIARCH -
> regardless of whether cross-compiling or not.
Practically, they already have. But unconditionally passing
CMAKE_INSTALL_LIBDIR might make even more sense, yes.
Helmut