Skip to content

More cmake enhancements#95

Merged
vadz merged 9 commits into
vslavik:masterfrom
vadz:more-cmake-enhancements
Jul 23, 2025
Merged

More cmake enhancements#95
vadz merged 9 commits into
vslavik:masterfrom
vadz:more-cmake-enhancements

Conversation

@vadz

@vadz vadz commented Jul 18, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

vadz added 7 commits July 19, 2025 00:20
Fix syntax of the version check: previously, we searched for any version
of libxml-2.0 and then, if not found, for ">=" and "2.4.28" modules (!).
Remove spaces to do what we really need to do.

Also use pkg_check_modules() rather than pkg_search_module() because the
latter is meant for searching for multiple modules, but here we know
which module we need, so use the simpler command instead.
There was a typo changing the meaning of the comment there.
Setting CMAKE_CXX_COMPILER_VISIBILITY_PRESET didn't work (any more?), so
do it properly, by setting per-target options.

Also define the necessary symbols, i.e. DLL_EXPORT when building the
libraries and XMLWRAPP_USE_DLL or XSLTWRAPP_USE_DLL when using them.
This makes the binary relocatable.

Rename use_hidden_visibility() function to setup_shared_library() as it
now does more than just sets up the hidden visibility.
As this is something that only needs to be done for shared libraries
(and always needs to be done for them), do it in the same function that
is already used for setting visibility and runpath options.
Allow customizing the shared libraries names.

This is useful to avoid conflicts with the other libraries that may be
present on the system.
Add missing XMLWRAPP_API to the functions declarations.
@vadz vadz force-pushed the more-cmake-enhancements branch from 05552b0 to 8458396 Compare July 18, 2025 22:25
@vadz vadz marked this pull request as ready for review July 19, 2025 15:15
vadz added 2 commits July 23, 2025 00:53
Don't give the same message every time CMake is rerun, this is more
annoying than useful.
The library is expected to define these targets too by convention, so
do it.
@vadz vadz force-pushed the more-cmake-enhancements branch from 43fe371 to ad98434 Compare July 22, 2025 23:01
@vadz vadz merged commit ad98434 into vslavik:master Jul 23, 2025
14 checks passed
@vadz vadz deleted the more-cmake-enhancements branch July 23, 2025 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant