Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#903042: debhelper: cmake build system sets CMAKE_INSTALL_LIBDIR=lib/MULTIARCH, but only when cross-compiling

10 views
Skip to first unread message

Simon McVittie

unread,
Jul 5, 2018, 10:40:02 AM7/5/18
to
Package: debhelper
Version: 11.3.5
Severity: normal

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.

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.

In future compat levels (12+? 13+?), presumably lib/MULTIARCH ought to
be the default for both native and cross builds?

smcv

Helmut Grohne

unread,
Jul 5, 2018, 11:40:03 AM7/5/18
to
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
0 new messages