Giter VIP home page Giter VIP logo

msvc.py's Introduction

msvc.py

Run one-shot commands under Visual Studio developer prompt. Use any shell with Visual Studio developer prompt. Dump developer prompt environment variables.

For fast startup, use the --read-cache and --write-cache options. The cache will contain all environment variables in plaintext, so make sure you don't have any sensitive data in your environment variables when using --write-cache. The cache will be automatically regenerated when the underlying Visual Studio installation is detected to be updated.

Examples

# one-shot under VS dev prompt
> ./msvc.py run cl /nologo hello.c
Microsoft (R) C/C++ Optimizing Compiler Version 19.37.32825 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

hello.c
Microsoft (R) Incremental Linker Version 14.37.32825.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:hello.exe
hello.obj
# list installed visual studio instances
> ./msvc.py list
953270db VisualStudio/17.7.6+34221.43 x64 C:\Program Files\Microsoft Visual Studio\2022\Professional
# dump visual studio environment variables (truncated for brevity)
> ./msvc.py dump
...
VCIDEInstallDir=C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\VC\
VCINSTALLDIR=C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\
VCPKG_DEFAULT_TRIPLET=x64-windows
VCToolsInstallDir=C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.37.32822\
VCToolsRedistDir=C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Redist\MSVC\14.36.32532\
VCToolsVersion=14.37.32822
VisualStudioVersion=17.0
VS170COMNTOOLS=C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Tools\
VSCMD_ARG_app_plat=Desktop
VSCMD_ARG_HOST_ARCH=x64
VSCMD_ARG_no_logo=1
VSCMD_ARG_TGT_ARCH=x64
VSCMD_VER=17.7.6
...
# start a visual studio developer prompt with nushell
> nu -e 'python "./msvc.py" dump --json | from json | load-env'

msvc.py's People

Contributors

midrare avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.