Skip to content

Commit 8b30058

Browse files
committed
interpreter: move deprecation validation for *_pch to the interpreter
1 parent 20124c8 commit 8b30058

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

mesonbuild/build.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,8 +1610,6 @@ def add_pch(self, language: str, pchlist: T.List[str]) -> None:
16101610
if os.path.dirname(pchlist[0]) != os.path.dirname(pchlist[1]):
16111611
raise InvalidArguments('PCH files must be stored in the same folder.')
16121612

1613-
FeatureDeprecated.single_use('PCH source files', '0.50.0', self.subproject,
1614-
'Only a single header file should be used.')
16151613
for f in pchlist:
16161614
if not os.path.isfile(os.path.join(self.environment.source_dir, self.subdir, f)):
16171615
raise MesonException(f'File {f} does not exist.')

mesonbuild/interpreter/type_checking.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
BothLibraries, SharedLibrary, StaticLibrary, Jar, Executable, StructuredSources)
1414
from ..options import OptionKey, UserFeatureOption
1515
from ..dependencies import Dependency, DependencyMethods, InternalDependency
16-
from ..interpreterbase.decorators import KwargInfo, ContainerTypeInfo, FeatureBroken
16+
from ..interpreterbase.decorators import KwargInfo, ContainerTypeInfo, FeatureBroken, FeatureDeprecated
1717
from ..mesonlib import (File, FileMode, MachineChoice, has_path_sep, listify, stringlistify,
1818
EnvironmentVariables)
1919
from ..programs import ExternalProgram
@@ -658,12 +658,18 @@ def _pch_validator(args: T.List[str]) -> T.Optional[str]:
658658
return None
659659

660660

661+
def _pch_feature_validator(args: T.List[str]) -> T.Iterable[FeatureCheckBase]:
662+
if len(args) > 1:
663+
yield FeatureDeprecated('PCH source files', '0.50.0', 'Only a single header file should be used.')
664+
665+
661666
_PCH_ARGS: KwargInfo[T.List[str]] = KwargInfo(
662667
'pch',
663668
ContainerTypeInfo(list, str),
664669
listify=True,
665670
default=[],
666671
validator=_pch_validator,
672+
feature_validator=_pch_feature_validator,
667673
)
668674

669675

0 commit comments

Comments
 (0)