@ -769,13 +769,20 @@ class Environment:
subproject = ' '
subproject = ' '
if section == ' built-in options ' :
if section == ' built-in options ' :
for k , v in values . items ( ) :
for k , v in values . items ( ) :
key = OptionKey . from_string ( k ) . evolve ( subproject = subproject , machine = machine )
key = OptionKey . from_string ( k )
self . options [ key ] = v
# If we're in the cross file, and there is a `build.foo` warn about that. Later we'll remove it.
if machine is MachineChoice . HOST and key . machine is not machine :
mlog . deprecation ( ' Setting build machine options in cross files, please use a native file instead, this will be removed in meson 0.60 ' , once = True )
if key . subproject :
raise MesonException ( ' Do not set subproject options in [built-in options] section, use [subproject:built-in options] instead. ' )
self . options [ key . evolve ( subproject = subproject , machine = machine ) ] = v
elif section == ' project options ' :
elif section == ' project options ' :
for k , v in values . items ( ) :
for k , v in values . items ( ) :
# Project options are always for the machine machine
# Project options are always for the machine machine
key = OptionKey . from_string ( k ) . evolve ( subproject = subproject )
key = OptionKey . from_string ( k )
self . options [ key ] = v
if key . subproject :
raise MesonException ( ' Do not set subproject options in [built-in options] section, use [subproject:built-in options] instead. ' )
self . options [ key . evolve ( subproject = subproject ) ] = v
def _set_default_options_from_env ( self ) - > None :
def _set_default_options_from_env ( self ) - > None :
opts : T . List [ T . Tuple [ str , str ] ] = (
opts : T . List [ T . Tuple [ str , str ] ] = (