Files
CMake/Tests/RunCMake/GeneratorExpression/configtest.c
Matthew Woehlke 8ac826a5f2 GenEx: Fix evaluation of $<CONFIG> on imported targets
The historic implementation of `$<CONFIG>` had some errors that could
result in multiple configurations matching. First, it always considered
the configuration of the consuming target, even if a consumed imported
target selected a different configuration. Second, it matched the entire
list of `MAP_IMPORTED_CONFIG_<CONFIG>` configurations, even if none of
those were actually selected. The latter in particular is redundant at
best, as we also consider the selected configuration of an imported
target, which is the correct configuration to match for imported
targets. Refactor the implementation so that only one configuration is
considered.

Fixes: #23660
Issue: #27022
2025-07-30 15:12:03 -04:00

35 lines
507 B
C

#ifdef EXPECT_DEBUG
# ifndef DEBUG
# error DEBUG should be defined
# endif
#else
# ifdef DEBUG
# error DEBUG should not be defined
# endif
#endif
#ifdef EXPECT_RELEASE
# ifndef RELEASE
# error RELEASE should be defined
# endif
#else
# ifdef RELEASE
# error RELEASE should not be defined
# endif
#endif
#ifdef EXPECT_TEST
# ifndef TEST
# error TEST should be defined
# endif
#else
# ifdef TEST
# error TEST should not be defined
# endif
#endif
int main(void)
{
return 0;
}