summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/build.py2
-rw-r--r--mesonbuild/interpreter/type_checking.py8
2 files changed, 7 insertions, 3 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index efba76b04..8241efa1d 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -1610,8 +1610,6 @@ class BuildTarget(Target):
if os.path.dirname(pchlist[0]) != os.path.dirname(pchlist[1]):
raise InvalidArguments('PCH files must be stored in the same folder.')
- FeatureDeprecated.single_use('PCH source files', '0.50.0', self.subproject,
- 'Only a single header file should be used.')
for f in pchlist:
if not os.path.isfile(os.path.join(self.environment.source_dir, self.subdir, f)):
raise MesonException(f'File {f} does not exist.')
diff --git a/mesonbuild/interpreter/type_checking.py b/mesonbuild/interpreter/type_checking.py
index 700041671..e582cd91b 100644
--- a/mesonbuild/interpreter/type_checking.py
+++ b/mesonbuild/interpreter/type_checking.py
@@ -13,7 +13,7 @@ from ..build import (CustomTarget, BuildTarget,
BothLibraries, SharedLibrary, StaticLibrary, Jar, Executable, StructuredSources)
from ..options import OptionKey, UserFeatureOption
from ..dependencies import Dependency, DependencyMethods, InternalDependency
-from ..interpreterbase.decorators import KwargInfo, ContainerTypeInfo, FeatureBroken
+from ..interpreterbase.decorators import KwargInfo, ContainerTypeInfo, FeatureBroken, FeatureDeprecated
from ..mesonlib import (File, FileMode, MachineChoice, has_path_sep, listify, stringlistify,
EnvironmentVariables)
from ..programs import ExternalProgram
@@ -658,12 +658,18 @@ def _pch_validator(args: T.List[str]) -> T.Optional[str]:
return None
+def _pch_feature_validator(args: T.List[str]) -> T.Iterable[FeatureCheckBase]:
+ if len(args) > 1:
+ yield FeatureDeprecated('PCH source files', '0.50.0', 'Only a single header file should be used.')
+
+
_PCH_ARGS: KwargInfo[T.List[str]] = KwargInfo(
'pch',
ContainerTypeInfo(list, str),
listify=True,
default=[],
validator=_pch_validator,
+ feature_validator=_pch_feature_validator,
)