[libcxx-commits] [PATCH] D99484: Use `GNUInstallDirs` to support custom installation dirs.
John Ericson via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Mar 28 21:49:28 PDT 2021
Ericson2314 created this revision.
Herald added subscribers: libc-commits, libcxx-commits, dcaballe, cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, kerbowa, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, csigg, antiagainst, shauheen, rriddle, mehdi_amini, arphaman, steven_wu, hiraditya, mgorny, nhaehnle, jvesely.
Herald added a reviewer: bollu.
Herald added a reviewer: ldionne.
Herald added a reviewer: sscalpone.
Herald added a reviewer: awarzynski.
Herald added projects: libunwind, libc-project.
Herald added a reviewer: libunwind.
Ericson2314 requested review of this revision.
Herald added subscribers: llvm-commits, openmp-commits, lldb-commits, Sanitizers, cfe-commits, stephenneuendorffer, nicolasvasilache.
Herald added projects: clang, Sanitizers, LLDB, libc++, OpenMP, libc++abi, MLIR, LLVM, clang-tools-extra.
Herald added a reviewer: libc++.
Herald added a reviewer: libc++abi.
This is a new draft of D28234 <https://reviews.llvm.org/D28234>. I previously did the unorthodox thing of
pushing to it when I wasn't the original author, but since this version
- Uses `GNUInstallDirs`, rather than mimics it, as the original author was hesitant to do but others requested.
- Is much broader, effecting many more projects than LLVM itself.
I figured it was time to make a new revision.
I am using this patch (and many back-ports) as the basis of
https://github.com/NixOS/nixpkgs/pull/111487 for my distro (NixOS). It
looked like people were generally on board in D28234 <https://reviews.llvm.org/D28234>, but I make note of
this here in case extra motivation is useful.
As pointed out in the original issue, a central tension is that LLVM
already has some partial support for these sorts of things. Sometimes
GNUInstallDirs alone is more expressive, but sometimes the existing
stuff is, e.g. with the "utils" vs "tools" distinction or perhaps when
everything is being built together.
Another related tension was that the GNUInstallDirs variables may be
relative `CMAKE_INSTALL_PREFIX` *or* absolute paths that need not lead
within that directory. We in fact do the common case in Nixpkgs (and in
my PR), where the package and "-dev" package data (analogizing from
conventional distros) are installed in separate prefixes. Supporting
this fall range of the GNU variables means this patch can't always be a
simple "find and replace" of `bin/`, `lib/`, `include/`, etc., as we
sometimes need to get clever where a leading `CMAKE_INSTALL_PREFIX` was
I am not a frequent LLVM contributor, so I didn't want to broach the
topic of removing functionality / breaking changes, so I instead
implemented GNUInstallDirs along side the existing stuff. Existing
custom install dirs are derived from the GNUInstallDirs ones by default,
but may be separately sepcified. Existing prefixes come before
`CMAKE_CONFIGURE_PREFIX`. In a few cases that was a small breaking
change when the default per-project prefix was itself
`CMAKE_CONFIGURE_PREFIX` rather than the empty string, but the majority
aready had the empty string default.
I do think it would be wise for others to remove some of the old install
dir mechanisms, as the LLVM CMake is already quite complex, but I would
strongly prefer to leave that to others who are more familiar with the
project and its main users' needs re compat vs features of the build
rG LLVM Github Monorepo
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 61044 bytes
Desc: not available
More information about the libcxx-commits