Skip to content

Option build_tests (default true) - #1042

Merged
NWilson merged 1 commit into
PCRE2Project:mainfrom
dirkz:dz/build_tests_option
Oct 14, 2026
Merged

NWilson merged 1 commit into
PCRE2Project:mainfrom
dirkz:dz/build_tests_option

Conversation

@dirkz

@dirkz dirkz commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Fixes issue #1041

@NWilson

NWilson commented Oct 14, 2026

Copy link
Copy Markdown
Member

Thanks!

Is this really sufficient? I would have expected the entire pcre2test block to be conditional, not just the final command to install it.

@dirkz

dirkz commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

Thanks!

Is this really sufficient? I would have expected the entire pcre2test block to be conditional, not just the final command to install it.

Yes, because without the link to the root of the build tree this a free-floating leaf, and nothing gets executed for it for the actual build.

Of course, I could make all code that deals with pcre2test* conditional. Then we need an optional var and more if-statements because it gets referenced later for posixlib. I can do it like this if you prefer.

@NWilson

NWilson commented Oct 14, 2026

Copy link
Copy Markdown
Member

I think I understand. Zig build has no all target like a conventional build system. The b.default_step for no-arg zig build is zig build install, and that target only pulls in objects from the tree linked by b.installArtifacts().

My mental model was based on make; make install where there's a step for build targets (all libs/exes) and the 'install' step is an extra thing afterwards.

Thanks for explaining.

@NWilson
NWilson merged commit 13e1da9 into PCRE2Project:main Oct 14, 2026
45 checks passed
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.

build.zig: Building the library for iOS succeeds, but building the tests then fails

2 participants