Skip to content

Conversation

apache-hb
Copy link
Contributor

Adds version 0.13.0 of libcbor

@apache-hb apache-hb force-pushed the libcbor-0.13.0 branch 6 times, most recently from b414921 to a3aeca7 Compare September 12, 2025 00:43
@apache-hb apache-hb marked this pull request as ready for review September 12, 2025 00:47

cc = meson.get_compiler('c')

tests_opt = get_option('tests').disable_auto_if(meson.is_subproject())
Copy link
Member

Choose a reason for hiding this comment

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

Why disable if it's a subproject?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the tests are left enabled in a subproject they'll all be built when running ninja install, which can be time consuming or at worst lead to build failures on stranger build configurations.


foreach path : tests
name = path.split('/')[1].replace('.c', '')
test_exe = executable(
Copy link
Member

Choose a reason for hiding this comment

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

Also use build_by_default: false.

This means you can also skip checking if the build is a subproject. The tests won't be built when including libcbor as a wrap, even if the testsuite is enabled -- they will only be built when running meson test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unless im mistaken targets with build_by_default: false will still be built during ninja install or equivalent, which can slow down builds a fair amount or lead to build failures. I really prefer to keep tests behind a feature for this reason.

Copy link
Member

Choose a reason for hiding this comment

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

Unless you add install: true, they won't be built.

That being said, it's pretty common to have a yielding feature tests option. I just don't like it behave differently when it's a subproject.

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.

3 participants