description | title | ms.date | helpviewer_keywords | monikerRange | ||||
---|---|---|---|---|---|---|---|---|
Learn more about: filter, filteri NMAKE functions |
filter, filteri NMAKE functions |
9/30/2021 |
|
>=msvc-170 |
Evaluates to a list of items that matched at least one pattern.
$(filter filters,input)
$(filteri filters,input)
filters
A list of one or more patterns to filter by.
input
The list to be filtered.
A list of all of the items in input
that match at least one pattern in filters
.
filteri
is the case-insensitive version of filter
.
This macro function is available starting in Visual Studio 2022, in NMAKE version 14.30 or later.
$(filter He%,Hello Hey Hi) # Evaluates to "Hello Hey" - "Hi" doesn't match the filter
$(filter %y %i,Hello Hey Hi) # Evaluates to "Hey Hi" - items are kept if they match any filter, "Hello" is dropped as it doesn't match any
$(filter Not%Found,Hello Hey Hi) # Evaluates to "" - none of the items match any filters
$(filter he%,Hello Hey Hi) # Evaluates to "" - filter is case-sensitive
$(filteri he%,Hello Hey Hi) # Evaluates to "Hello Hey" - filteri is case-insensitive
# filteri is commonly used to filter a list of files by their extensions
CPP_SOURCES=$(filteri %.cpp %.cxx,$(SOURCES))
C_SOURCES=$(filteri %.c,$(SOURCES))
Macros and NMAKE
NMAKE functions by category
filterout
, filterouti