Skip FeatureNew checks when project() has not been parsed

Fixes https://github.com/mesonbuild/meson/issues/3944
pull/4015/head
Nirbheek Chauhan 6 years ago committed by Nirbheek Chauhan
parent ecede89b5d
commit 43ececb036
  1. 3
      mesonbuild/interpreterbase.py
  2. 3
      test cases/common/38 run program/get-version.py
  3. 2
      test cases/common/38 run program/meson.build

@ -172,6 +172,9 @@ class FeatureCheckBase:
@staticmethod @staticmethod
def get_target_version(subproject): def get_target_version(subproject):
# Don't do any checks if project() has not been parsed yet
if subproject not in mesonlib.project_meson_versions:
return ''
return mesonlib.project_meson_versions[subproject] return mesonlib.project_meson_versions[subproject]
def use(self, subproject): def use(self, subproject):

@ -0,0 +1,3 @@
#!/usr/bin/env python3
print('1.2')

@ -1,4 +1,4 @@
project('run command', 'c') project('run command', version : run_command('get-version.py', check : true).stdout().strip())
if build_machine.system() == 'windows' if build_machine.system() == 'windows'
c = run_command('cmd', '/c', 'echo', 'hello') c = run_command('cmd', '/c', 'echo', 'hello')

Loading…
Cancel
Save