Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for MSVC from non-standard locations #189

Open
NiklasRosenstein opened this issue Jan 4, 2018 · 0 comments
Open

Support for MSVC from non-standard locations #189

NiklasRosenstein opened this issue Jan 4, 2018 · 0 comments

Comments

@NiklasRosenstein
Copy link
Collaborator

In an effort to avoid the full-blown installation of Visual Studio, non-standard locations of the VC compiler toolkit should be supported. This has a number of implications/requirements:

  • Which files would be needed from the Visual Studio install directory? Is just the VC directory is not enough? Or does it require any other files (eg. from IDE or Common7)
  • VC/vcvarsall.bat does not take into account its own parent directory but instead uses absolute paths when it updates PATH, INCLUDE, etc. We might need to update the added paths to point to the correct location of the VC binaries, eg. in MsvcInstallation.environ():
    # Post-process paths in the environment. If this MsvcInstallation
    # represents a copied version the VC directory, the paths created
    # by vcvarsall are incorrect as it does not create them based on
    # the batch file's parent direcory but using absolute paths instead.
    replaces = [
      (r'C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC', os.path.join(self.directory, 'VC'))
    ]
    for key, value in environ.items():
      if key not in os.environ or value != os.environ[key]:
        for ref, subst in replaces:
          offset = 0
          while True:
            index = value.lower().find(ref.lower(), offset)
            if index < 0: break
            value = value[:index] + subst + value[index+len(ref):]
            offset = index + len(subst)
        environ[key] = value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant