Skip to content

Conversation

@jschuh
Copy link
Contributor

@jschuh jschuh commented Jul 5, 2021

Batch file that offers a single command line and sensible defaults to: initialize the primary Visual Studio build environment, handle directory creation/cleaning, run cmake, launch msbuild, etc.

It should work on any running version of Windows, as I believe all command and shell options used are supported from at least Vista onward.

Usage examples:

  • Initial build after new checkout: build_win -d "c:\src\PrusaSlicer-deps"
  • Deps change: build_win -s all
  • Normal app rebuild (without cleaning): build_win

Batch file that offers a single command line and sensible defaults to:
initialize the primary Visual Studio build environment, handle directory
creation/cleaning, run cmake, launch msbuild, etc.
@bubnikv bubnikv merged commit b97b40a into prusa3d:master Jul 8, 2021
@bubnikv
Copy link
Collaborator

bubnikv commented Jul 8, 2021

Thank you indeed. I have merged into master.

Where did you draw you inspiration from? I was not aware this is doable with Windows batch at all.

Would you please extend the script so it will allow defining the destdir with a relative path, such as the following?

build_win.bat -d local-destdir

Thank you.

@jschuh
Copy link
Contributor Author

jschuh commented Jul 8, 2021

Where did you draw you inspiration from? I was not aware this is doable with Windows batch at all.

I was just annoyed that PR #6667 was wrong entirely because I hadn't wanted to hassle with a full deps-up rebuild. So, I just mashed up and polished off some of my old batch files, to make it easy to do command line rebuilds in the future. And I figured I'd share in case anyone else found it useful.

Anyway, Windows batch is an ugly language, and PowerShell will probably make it unnecessary in another few years. But it's still the most universal scripting language on Windows, and something I just know from doing Windows dev and security since WinNT 4 in the mid '90s.

Would you please extend the script so it will allow defining the destdir with a relative path, such as the following?

build_win.bat -d local-destdir

Yeah, it should be easy to have -d accept qualified or relative paths (call parameter expansion can perform the canonicalization in a trivial batch function). I don't have time to test it right now, but I should be able to code it up later today and put up a short PR.

@jschuh jschuh mentioned this pull request Jul 9, 2021
@KimmoHop
Copy link

How does it install slicer? Or how should it be started?

@jschuh jschuh deleted the build_win branch July 29, 2021 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants