MaulingMonkey/cargo-vs

autogenerate visual studio solutions / projects

17

stars

9

commits

Rust

primary language

Oct 15, 2023

updated

2017
cargo
rust
studio
visual
vs

README

cargo-vs • autogenerate visual studio solutions / projects

GitHub crates.io %23![forbid(unsafe_code)] rust: stable License Build Status

Quickstart

cd my-rust-project
cargo install cargo-vs
cargo vs2017
"%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe" vs\vs2017.sln

What's generated?

vs/.gitignore since many/most projects don't want .vsode boilerplate checked in IME (although I always provide mine)
vs/vs2017.sln
vs/vs2017/*.vcsproj - Makefile style projects which will invoke cargo +stable-%ARCH%-pc-windows-msvc build --target %ARCH%-pc-windows-msvc --package [package] [--bin|--example] [target] [--release]

Caveat: 32-bit (x86/Win32) builds require an i686 toolchain

When MSVC configures a build environment, rustc will pick up the %PATH% provided link.exe.
On the plus side, this means it should work for new VS versions rustc doesn't recognize.
On the minus side, this means that build.rs and your target use the same linker, and must match architectures.
This could be "fixed" by clearing a bunch of environment variables, but...

Why makefile projects instead of .vs/*.vs.json?

  • Easier to retrofit support for legacy Visual Studio versions
  • Presumably easier to integrate into your existing C++/C# msbuild mess
  • I can't figure out how to launch the graphics debugger with .vs/*
  • Proper build matricies

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Contributors

MaulingMonkey

9 commits

MaulingMonkey/cargo-vs

autogenerate visual studio solutions / projects

17

stars

9

commits

Rust

primary language

Oct 15, 2023

updated

2017
cargo
rust
studio
visual
vs

README

cargo-vs • autogenerate visual studio solutions / projects

GitHub crates.io %23![forbid(unsafe_code)] rust: stable License Build Status

Quickstart

cd my-rust-project
cargo install cargo-vs
cargo vs2017
"%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe" vs\vs2017.sln

What's generated?

vs/.gitignore since many/most projects don't want .vsode boilerplate checked in IME (although I always provide mine)
vs/vs2017.sln
vs/vs2017/*.vcsproj - Makefile style projects which will invoke cargo +stable-%ARCH%-pc-windows-msvc build --target %ARCH%-pc-windows-msvc --package [package] [--bin|--example] [target] [--release]

Caveat: 32-bit (x86/Win32) builds require an i686 toolchain

When MSVC configures a build environment, rustc will pick up the %PATH% provided link.exe.
On the plus side, this means it should work for new VS versions rustc doesn't recognize.
On the minus side, this means that build.rs and your target use the same linker, and must match architectures.
This could be "fixed" by clearing a bunch of environment variables, but...

Why makefile projects instead of .vs/*.vs.json?

  • Easier to retrofit support for legacy Visual Studio versions
  • Presumably easier to integrate into your existing C++/C# msbuild mess
  • I can't figure out how to launch the graphics debugger with .vs/*
  • Proper build matricies

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

See what people are saying

Contributors

MaulingMonkey

9 commits

Languages

Rust

100.0%