Coder Social home page Coder Social logo

vcvars-bash's Introduction

vcvars-bash

Use the Microsoft C++ toolset from Bash!

vcvarsall.sh

This script load MSVC environment variables using vcvarsall.bat and exports them. It is intended to be evaluated (by Bash or any other POSIX-compatible shell, since it writes a list of export commands to stdout).

Usage: eval "$(vcvarsall.sh [vcvarsall.bat arguments])"

See Microsoft vcvarsall.bat syntax for vcvarsall.bat arguments documentation.

Example:

eval "$(./vcvarsall.sh x64)"
cmake -S ..  -B build -G "NMake Makefiles"
cmake --build build --config Release

vcvarsrun.sh

Like vcvarsall.sh, but runs a command instead of exporting variables.

Usage: vcvarsrun.sh [vcvarsall.bat arguments] -- command [arguments...]

Example:

./vcvarsrun.sh x64 -- cl /nologo /EHsc /Fe:hello.exe hello.cpp
./vcvarsrun.sh x64 -- ./my_build_script.sh

Compatibility

These scripts are designed to run on Windows with Bash. They work with:

  • Git Bash
  • WSL
  • MSYS2
  • Cygwin

Configuration (optional)

To work, these scripts must locate vcvarsall.bat.
By default, it uses vswhere.exe (installed with Visual Studio) to automatically find the latest Visual Studio installation.
You can override this behavior by setting the VSINSTALLDIR environment variable (e.g. VSINSTALLDIR='C:\Program Files\Microsoft Visual Studio\2022\Community').

vcvars-bash's People

Contributors

nathan818fr avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

rdbo cyanoxygen

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.