def process_explicit_toolset_requests(): extra_properties = [] option_toolsets = [e for option in b2.util.regex.transform(sys.argv, "^--toolset=(.*)$") for e in option.split(',')] feature_toolsets = [e for option in b2.util.regex.transform(sys.argv, "^toolset=(.*)$") for e in option.split(',')] for t in option_toolsets + feature_toolsets: # Parse toolset-version/properties. (toolset_version, toolset, version) = re.match("(([^-/]+)-?([^/]+)?)/?.*", t).groups() if debug_config: print "notice: [cmdline-cfg] Detected command-line request for '%s': toolset= %s version=%s" \ % (toolset_version, toolset, version) # If the toolset is not known, configure it now. known = False if toolset in feature.values("toolset"): known = True if known and version and not feature.is_subvalue("toolset", toolset, "version", version): known = False # TODO: we should do 'using $(toolset)' in case no version has been # specified and there are no versions defined for the given toolset to # allow the toolset to configure its default version. For this we need # to know how to detect whether a given toolset has any versions # defined. An alternative would be to do this whenever version is not # specified but that would require that toolsets correctly handle the # case when their default version is configured multiple times which # should be checked for all existing toolsets first. if not known: if debug_config: print "notice: [cmdline-cfg] toolset '%s' not previously configured; attempting to auto-configure now" % toolset_version if version is not None: using(toolset, version) else: using(toolset) else: if debug_config: print "notice: [cmdline-cfg] toolset '%s' already configured" % toolset_version # Make sure we get an appropriate property into the build request in # case toolset has been specified using the "--toolset=..." command-line # option form. if not t in sys.argv and not t in feature_toolsets: if debug_config: print "notice: [cmdline-cfg] adding toolset=%s) to the build request." % t ; extra_properties += "toolset=%s" % t return extra_properties