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

build: link tests and benches against shared library, not static library #615

Merged
merged 5 commits into from
Feb 5, 2025

Conversation

bluetech
Copy link
Member

This makes the tests, and especially benches, more realistic, since xkbcommon is almost always used as a shared library.

Also significantly reduces the build time with LTO enabled (for me, from 90s to 30s).

@bluetech bluetech force-pushed the meson-tests-shared branch 5 times, most recently from 72354da to ef940c3 Compare January 25, 2025 05:30
@bluetech
Copy link
Member Author

With some effort I got windows to work, unfortunately it required some additional commits.

@wismill
Copy link
Member

wismill commented Jan 25, 2025

Nice work!

Could you add a milestone to your PRs, if relevant? We are close to 1.8 release. Unfortunately, I also found myself keeping adding MRs after discovering bugs or limitations, but we ought to do the release soon, else we may miss some distro packages freeze that will not ship important bug fixes.

@bluetech bluetech added this to the 1.9.0 milestone Jan 25, 2025
@bluetech
Copy link
Member Author

Sure -- I added this and #614 to the 1.9.0 milestone.

@wismill wismill added enhancement Indicates new feature requests testing Indicates a need for improvements or additions to testing labels Jan 29, 2025
@bluetech bluetech force-pushed the meson-tests-shared branch 2 times, most recently from 938f282 to 2c1dd81 Compare February 5, 2025 10:22
@bluetech
Copy link
Member Author

bluetech commented Feb 5, 2025

Looks like S_ISFIFO is not available on Windows. There's also a new warning on execv. Not sure how it compiled before. Will look into it.

The Windows dllexport annotation wants to be on the declarations, not
the definitions.

Signed-off-by: Ran Benita <[email protected]>
Without this, the test-internal libraries (which don't use the .def file
because they contain additional private symbols) can't be made shared.
But it also makes sense for consistency with GCC.

Signed-off-by: Ran Benita <[email protected]>
This makes the tests, and especially benches, more realistic, since
xkbcommon is almost always used as a shared library.

Also significantly reduces the build time with LTO enabled (for me, from
90s to 30s).

Signed-off-by: Ran Benita <[email protected]>
@bluetech
Copy link
Member Author

bluetech commented Feb 5, 2025

Added a fix for the Windows error & warning, should be good now...

Copy link
Member

@wismill wismill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I have trust you on this one.

@bluetech bluetech merged commit 113ac30 into master Feb 5, 2025
5 checks passed
@bluetech bluetech deleted the meson-tests-shared branch February 5, 2025 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Indicates new feature requests testing Indicates a need for improvements or additions to testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants