feat(gtest): gate gtest_main behind 'main' feature (mcpp #168)#45
Merged
Conversation
gtest_main.cc provides its own main(); linked by default it collides with a
consumer's own main (e.g. app via mcpp add gtest + mcpp build → LNK2005).
Gate it behind the 'main' feature: kept in base sources (old mcpp ignores
features → no regression) AND listed under features.main.sources so new mcpp
(>=0.0.65) excludes it by default and includes it only with
gtest = { version=..., features=["main"] }. mcpp test's dev-dep main detection
is unaffected (gating is build-mode only).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gate gtest_main.cc behind a
mainfeature so it isn't linked by default (fixes mcpp-community/mcpp#168 where a regular-dep gtest collided with the app's main).Compat: gtest_main.cc stays in base
sourcestoo, so old mcpp (ignoresfeatures) is unaffected (verified: 0.0.64mcpp teststill works against this descriptor). New mcpp (>=0.0.65) treats feature-listed sources as gated → default framework-only,features=["main"]opts in.Pairs with mcpp 0.0.65 (feature-gated sources +
mcpp add --dev).