All Projects → bruxisma → VCVars

bruxisma / VCVars

Licence: MIT license
Add, Push, or Pop Visual C++ environment variables to your system PATH

Programming Languages

powershell
5483 projects

Projects that are alternatives of or similar to VCVars

wsock-trace
Tracing library for Winsock calls.
Stars: ✭ 15 (-21.05%)
Mutual labels:  msvc
MSVCLibXlsxWriter
A MSVC project to build a Windows DLL for libxlsxwriter
Stars: ✭ 18 (-5.26%)
Mutual labels:  msvc
docker-msvc-cpp
Dockerized Visual C++ environment with wine
Stars: ✭ 60 (+215.79%)
Mutual labels:  msvc
singlefile
featured cs:go internal hack, one file and less than 1000 lines.
Stars: ✭ 47 (+147.37%)
Mutual labels:  msvc
ci playground
Playground for Cloud CI development for C++
Stars: ✭ 23 (+21.05%)
Mutual labels:  msvc
libssh
Unofficial LibSSH with added custom native Visual Studio project build tools. LibSSH: Mulitplatform C library implementing the SSHv2 and SSHv1 protocol for client and server implementations.
Stars: ✭ 21 (+10.53%)
Mutual labels:  msvc
fp256
An efficient library for 256 bit integer arithmetic
Stars: ✭ 21 (+10.53%)
Mutual labels:  msvc
build-scripts
Utility scripts for building of 3rd-party libraries
Stars: ✭ 33 (+73.68%)
Mutual labels:  msvc
gmp
Unofficial GMP with added custom native Visual Studio project build tools. GMP: GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating-point numbers.
Stars: ✭ 61 (+221.05%)
Mutual labels:  msvc
CVIP
C/C++/Golang/Linux...知识整理
Stars: ✭ 62 (+226.32%)
Mutual labels:  msvc
CornerstoneSDK
面向现代 C++ 的小栗子框架插件开发工具(停止更新,仅支持小栗子v2)
Stars: ✭ 37 (+94.74%)
Mutual labels:  msvc
Cppcoro
A library of C++ coroutine abstractions for the coroutines TS
Stars: ✭ 2,118 (+11047.37%)
Mutual labels:  msvc
FFmpeg
Unofficial FFmpeg with added custom native Visual Studio project build tools. FFmpeg: A complete, cross-platform solution to record, convert and stream audio and video.
Stars: ✭ 479 (+2421.05%)
Mutual labels:  msvc
x265
Unofficial X265 with added custom native Visual Studio project build tools. X265: x265 is an open-source project and free application library for encoding video streams into the H.265/High Efficiency Video Coding (HEVC) format.
Stars: ✭ 23 (+21.05%)
Mutual labels:  msvc
Hello-GLUT
A very simple "Hello World!" GLUT application demonstrating how to write OpenGL applications in C with MinGW and MSVC.
Stars: ✭ 27 (+42.11%)
Mutual labels:  msvc
stlkrn
C++ STL in the Windows Kernel with C++ Exception Support
Stars: ✭ 216 (+1036.84%)
Mutual labels:  msvc
yuzaos
An operating system written in C++, MSVC
Stars: ✭ 23 (+21.05%)
Mutual labels:  msvc

VCVars Overview

VCVars is a pure Powershell 5 module for adding, pushing, and popping MSVC environment variables to your system PATH. It's released under the MIT License.

Get buck wild.

Installation

VCVars is currently published on the PowershellGallery:

Install-Module -Name VCVars

If you are not in an administrator powershell instance, and lack the permissions to launch one, simply install to the CurrentUser scope:

Install-Module -Name VCVars -Scope CurrentUser

Implicit module importing should handle the rest. Because VCVars is not supported prior to Powershell 5, there is not other supported way of installed VCVars.

Features

VCVars currently has a small, but decent set of features:

  • (optional) stack based environment variable control
  • All Visual Studio editions support (Including BuildTools, the minimal C++ installation!)
  • Universal Windows Platform support
  • Parameters to set cross compiling
  • Some argument completion behavior

Cmdlets and Aliases

VCVars cmdlets effectively work on hashtables that represent a set of environment variables. Eventually it will affect your Powershell env: drive.

VCVars provides the following commands:

  • Push-VCVars -- Pushes a new environment onto the stack
  • Pop-VCVars -- Pops an environment off the stack and returns it
  • Invoke-VCVars -- Calls a vcvarsall.bat and returns an environment
  • Find-VCVars -- Returns a list of all vcvarsall.bat files
  • Set-VCVars -- Forcibly sets the environment variables
  • Clear-VCVars -- Attempts to remove all VCVars from the environment
  • Find-VCWindowsKitsVersions -- Returns a list of currently installed Windows Kits.

VCVars utilizes the Find-VCWindowsKitsVersions cmdlet as an argument completer for the Invoke-VCVars's SDK parameter.

VCVars also provides a few aliases for the common commands:

  • pushvc -> Push-VCVars
  • popvc -> Pop-VCVars
  • vcvars -> Invoke-VCVars
  • setvc -> Set-VCVars

Roadmap

VCVars isn't fully polished, but it works right now. I'd rather get some feedback than miss the boat entirely. That said, future plans for VCVars are:

  • Write better documentation
  • (possibly) Support older versions of Visual Studio
  • Better checking of various VSSetup components, such as android or linux support.

Example Usage

The simplest (and arguably most common) way to use VCVars is with the following command:

setvc (vcvars)

This will set your environment variables using the most recently installed Visual Studio installation, without Universal Windows Platform support, on an amd64 host, targeting amd64. Running Get-Help Invoke-VCVars will show you parameters on how to configure your environment.

Why Does This Exist?

If you're like me, you like to work from the commandline when using the Microsoft Visual C++ Compiler (also known as MSVC) or when writing Rust. However, it still requires you to use a batch file alongside cmd.exe to run commands. This isn't acceptable in this, the year of our Goku 2017. This module gives several Powershell cmdlets for interacting with (and setting) the environment variables that MSVC requires. It also offers a few 'intrinsic' cmdlets to peer into some information regarding your various MSVC 2017 installs

This kind of module has been done several times, and some of them support older versions of MSVC (such as 2013 or 2015). However, those rely on a tool known as vswhere.exe, which either requires a user to download it themselves, or for me to distribute an already built version. I prefer a pure Powershell approach. As such, VCVars requires the VSSetup powershell module. If VSSetup does not know how to find versions of Visual Studio before 2017, then neither will VCVars. It also currently requires Powershell 5 and assumes you're on an amd64 architecture machine (it does support declaring cross compiling, or forcing an x86 host). Some work could likely be done to get it down to Powershell 3 and x86 hosts, but I'm lazy.

Pull requests are welcome.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].