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

CMake via meson places libraries in the wrong place #13931

Open
KaruroChori opened this issue Nov 20, 2024 · 1 comment
Open

CMake via meson places libraries in the wrong place #13931

KaruroChori opened this issue Nov 20, 2024 · 1 comment
Labels
module:cmake Issues related to the cmake module, including cmake.subproject

Comments

@KaruroChori
Copy link

Describe the bug
CMake projects when used via meson will misplace library files.
On some systems files will end up in /usr/lib in place of /usr/lib/x86_64-linux-gnu, on others in /app/lib64 in place of /app/lib.
Meson on the other hand properly places files.

To Reproduce
I created a simple repo to show this issue.
The choice of libraries is just random, all those I tested exhibited the same behaviour.
https://github.com/KaruroChori/meson-report-error

Expected behavior
CMake should install files in the same folders as meson unless explicitly overridden. Meson is able to determine the right paths for the involved architecture, CMake wrapped by meson is not.

system parameters
I was able to report this on both debian-trixie and freedesktop-24.08 so it is not an isolated issue specific to my configuration.
On my system I am using meson 1.5.2, python 3.12.6, debian-trixie, native build, ninja 1.12.1 and cmake 3.30.3.

@eli-schwartz eli-schwartz added the module:cmake Issues related to the cmake module, including cmake.subproject label Nov 21, 2024
@KaruroChori
Copy link
Author

I checked the files generated by meson to look for suspicious things.
In intro-install_plan.json

{
  "targets": {
    "/home/checkroom/Documents/projects/meson-bugreport/build/subprojects/libtcc/libtcc.so": {
      "destination": "{libdir_shared}/libtcc.so",
      "tag": "runtime",
      "subproject": "libtcc"
    },
    "/home/checkroom/Documents/projects/meson-bugreport/build/subprojects/quickjs/libqjs.a": {
      "destination": "{prefix}/lib/libqjs.a",
      "tag": "devel",
      "subproject": "quickjs"
    },
....

I think it should have been something like {libdir} or {libdir_static}, but it ends up being hardocded with lib somehow.

The meson.build generated for quickjs (the cmake project) has install_dir : 'lib', for libqjs.a which I am also not sure it is right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:cmake Issues related to the cmake module, including cmake.subproject
Projects
None yet
Development

No branches or pull requests

2 participants