| 333 | # be processed as if they had been specified by the user. |
| 334 | # |
| 335 | def process_explicit_toolset_requests(): |
| 336 | |
| 337 | extra_properties = [] |
| 338 | |
| 339 | option_toolsets = [e for option in b2.util.regex.transform(sys.argv, "^--toolset=(.*)$") |
| 340 | for e in option.split(',')] |
| 341 | feature_toolsets = [e for option in b2.util.regex.transform(sys.argv, "^toolset=(.*)$") |
| 342 | for e in option.split(',')] |
| 343 | |
| 344 | for t in option_toolsets + feature_toolsets: |
| 345 | |
| 346 | # Parse toolset-version/properties. |
| 347 | (toolset_version, toolset, version) = re.match("(([^-/]+)-?([^/]+)?)/?.*", t).groups() |
| 348 | |
| 349 | if debug_config: |
| 350 | print "notice: [cmdline-cfg] Detected command-line request for '%s': toolset= %s version=%s" \ |
| 351 | % (toolset_version, toolset, version) |
| 352 | |
| 353 | # If the toolset is not known, configure it now. |
| 354 | known = False |
| 355 | if toolset in feature.values("toolset"): |
| 356 | known = True |
| 357 | |
| 358 | if known and version and not feature.is_subvalue("toolset", toolset, "version", version): |
| 359 | known = False |
| 360 | # TODO: we should do 'using $(toolset)' in case no version has been |
| 361 | # specified and there are no versions defined for the given toolset to |
| 362 | # allow the toolset to configure its default version. For this we need |
| 363 | # to know how to detect whether a given toolset has any versions |
| 364 | # defined. An alternative would be to do this whenever version is not |
| 365 | # specified but that would require that toolsets correctly handle the |
| 366 | # case when their default version is configured multiple times which |
| 367 | # should be checked for all existing toolsets first. |
| 368 | |
| 369 | if not known: |
| 370 | |
| 371 | if debug_config: |
| 372 | print "notice: [cmdline-cfg] toolset '%s' not previously configured; attempting to auto-configure now" % toolset_version |
| 373 | if version is not None: |
| 374 | using(toolset, version) |
| 375 | else: |
| 376 | using(toolset) |
| 377 | |
| 378 | else: |
| 379 | |
| 380 | if debug_config: |
| 381 | |
| 382 | print "notice: [cmdline-cfg] toolset '%s' already configured" % toolset_version |
| 383 | |
| 384 | # Make sure we get an appropriate property into the build request in |
| 385 | # case toolset has been specified using the "--toolset=..." command-line |
| 386 | # option form. |
| 387 | if not t in sys.argv and not t in feature_toolsets: |
| 388 | |
| 389 | if debug_config: |
| 390 | print "notice: [cmdline-cfg] adding toolset=%s) to the build request." % t ; |
| 391 | extra_properties += "toolset=%s" % t |
| 392 | |