be more tolerant when parsing new specs.
This commit is contained in:
parent
c90cc465f5
commit
f3d6818d5c
@ -526,7 +526,12 @@ def _add_flag(self, name, value):
|
||||
"""
|
||||
valid_flags = FlagMap.valid_compiler_flags()
|
||||
if name == 'arch' or name == 'architecture':
|
||||
platform, op_sys, target = value.split('-')
|
||||
parts = value.split('-')
|
||||
if len(parts) == 3:
|
||||
platform, op_sys, target = parts
|
||||
else:
|
||||
platform, op_sys, target = None, None, value
|
||||
|
||||
assert(self.architecture.platform is None)
|
||||
assert(self.architecture.platform_os is None)
|
||||
assert(self.architecture.target is None)
|
||||
@ -596,11 +601,13 @@ def _set_platform(self, value):
|
||||
|
||||
def _set_os(self, value):
|
||||
"""Called by the parser to set the architecture operating system"""
|
||||
self.architecture.platform_os = self.architecture.platform.operating_system(value)
|
||||
if self.architecture.platform:
|
||||
self.architecture.platform_os = self.architecture.platform.operating_system(value)
|
||||
|
||||
def _set_target(self, value):
|
||||
"""Called by the parser to set the architecture target"""
|
||||
self.architecture.target = self.architecture.platform.target(value)
|
||||
if self.architecture.platform:
|
||||
self.architecture.target = self.architecture.platform.target(value)
|
||||
|
||||
def _add_dependency(self, spec):
|
||||
"""Called by the parser to add another spec as a dependency."""
|
||||
|
Loading…
Reference in New Issue
Block a user