Skip to content

Best Practice for Setting Multiple Visual Studio MSVC targets #718

Closed
@jmw992

Description

@jmw992

I am producing libraries which will be accessible to multiple versions of Visual Studio 2017 & 2019. I've been doing some some research and found these pretty useful links

https://users.rust-lang.org/t/which-visual-studio-version-does-msvc-toolset-use/45098

https://www.reddit.com/r/rust/comments/7jnf58/any_way_to_control_which_version_of_visual_studio/

rust-lang/rust#38584

From theses it seems like the options are

  1. run vcvars*.bat of the desired target in the command prompt before running cargo build
  2. running the build in the correct VS Developer command prompts, ex "x64 Command Prompt for VS 2017".
  3. manually set the LIB & PATH environmental variables to the desired folders

It seems like Option 1 is the best for my team as it would require the least amount of setup for the Windows C++ dev consumers, as the only thing they'd have to do is install Rust and then batch files can take care of the rest.

Those discussions are for rust in general, I'm curious if there are better options specific to CXX, is it worth making the switch to using Bazel based building?

Metadata

Metadata

Assignees

No one assigned

    Labels

    windowsIssues that manifest on Windows

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions