(version=None, options=[])
| 599 | # |
| 600 | |
| 601 | def configure_really(version=None, options=[]): |
| 602 | v = version |
| 603 | if not v: |
| 604 | # Take the first registered (i.e. auto-detected) version. |
| 605 | version = __versions.first() |
| 606 | v = version |
| 607 | |
| 608 | # Note: 'version' can still be empty at this point if no versions have |
| 609 | # been auto-detected. |
| 610 | if not version: |
| 611 | version = "default" |
| 612 | |
| 613 | # Version alias -> real version number. |
| 614 | version = globals().get("__version_alias_{}".format(version), version) |
| 615 | |
| 616 | # Check whether the selected configuration is already in use. |
| 617 | if version in __versions.used(): |
| 618 | # Allow multiple 'toolset.using' calls for the same configuration if the |
| 619 | # identical sets of options are used. |
| 620 | if options and options != __versions.get(version,'options'): |
| 621 | raise RuntimeError("MSVC toolset configuration: Toolset version '$(version)' already configured.".format(version)) |
| 622 | else: |
| 623 | # Register a new configuration. |
| 624 | __versions.register(version) |
| 625 | |
| 626 | # Add user-supplied to auto-detected options. |
| 627 | version_opts = __versions.get(version, 'options') |
| 628 | if (version_opts): |
| 629 | options = version_opts + options |
| 630 | |
| 631 | # Mark the configuration as 'used'. |
| 632 | __versions.use(version) |
| 633 | # Generate conditions and save them. |
| 634 | conditions = common.check_init_parameters('msvc', None, ('version', v)) |
| 635 | __versions.set(version, 'conditions', conditions) |
| 636 | command = feature.get_values('<command>', options) |
| 637 | |
| 638 | # If version is specified, we try to search first in default paths, and |
| 639 | # only then in PATH. |
| 640 | command = common.get_invocation_command('msvc', 'cl.exe', command, default_paths(version)) |
| 641 | common.handle_options('msvc', conditions, command, options) |
| 642 | |
| 643 | if not version: |
| 644 | # Even if version is not explicitly specified, try to detect the |
| 645 | # version from the path. |
| 646 | # FIXME: We currently detect both Microsoft Visual Studio 9.0 and |
| 647 | # 9.0express as 9.0 here. |
| 648 | if re.search("Microsoft Visual Studio 12", command): |
| 649 | version = '12.0' |
| 650 | elif re.search("Microsoft Visual Studio 11", command): |
| 651 | version = '11.0' |
| 652 | elif re.search("Microsoft Visual Studio 10", command): |
| 653 | version = '10.0' |
| 654 | elif re.search("Microsoft Visual Studio 9", command): |
| 655 | version = '9.0' |
| 656 | elif re.search("Microsoft Visual Studio 8", command): |
| 657 | version = '8.0' |
| 658 | elif re.search("NET 2003[\/\\]VC7", command): |
no test coverage detected