Skip to content

Conversation

@julianneswinoga
Copy link
Contributor

This is a pretty basic thing that we should be pulling in from cmake

@bonzini bonzini added the module:cmake Issues related to the cmake module, including cmake.subproject label Jun 6, 2025
@jpakkane
Copy link
Member

jpakkane commented Jun 6, 2025

mesonbuild.interpreterbase.exceptions.InterpreterException: Assert failed: Shared library version not picked up correctly

Maybe because setting version/soversion changes the output file name?

@julianneswinoga
Copy link
Contributor Author

I added that assert to double check that the cmake-meson interop is setting the version correctly. On Linux the shared library version is just appended to the filename (libcmModLib.so.1.0.1) so I can just check the target path ends with the version. On other OSs that seems to not be the case. I can either make the assert for Linux-only builders, or do some research to see how shared libraries are version tagged on other OSs.

This is only because I don't see a way to get a version from a target object, if there's a nicer way I'd love to use that 😁

@julianneswinoga
Copy link
Contributor Author

Changed the test case assertion to be dependent on the host system.

Interestingly I also found that on Windows-Cygwin meson will name the library cygcmModLib-1.dll but cmake will name it cygcmModLib.dll 🤔

@julianneswinoga julianneswinoga force-pushed the bugfix/jswinoga/fix-parsing-cmake-library-version branch from 03aaf8c to 331d9de Compare August 2, 2025 14:38
@julianneswinoga
Copy link
Contributor Author

I just squashed the fixups, should be good to go now! 🙂

@dcbaker dcbaker added this to the 1.10 milestone Aug 3, 2025
@dcbaker
Copy link
Member

dcbaker commented Aug 3, 2025

This still looks good to me, I've added it the milestone for the next release so we can get it in once the merge window opens.

@eli-schwartz
Copy link
Member

Merge window is open, in it goes.

@eli-schwartz eli-schwartz merged commit 8992d4f into mesonbuild:master Aug 26, 2025
34 checks passed
@mmomtchev
Copy link
Contributor

mmomtchev commented Dec 13, 2025

This breaks with static libraries that export VERSION or SO_VERSION because the static_library target does not accept these kwargs. Now, should static libraries export these properties is a good question.

Many projects support being built as both shared or static library and I guess that very few filter out their target properties based on the library type.

@thesamesam
Copy link
Member

thesamesam commented Dec 13, 2025

The fix is in #15297.

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

Successfully merging this pull request may close these issues.

7 participants