简体   繁体   中英

Visual Studio 2015 - configuring a custom build batch file

I did this in Sublime Text Editor before, and wanted to know if it's possible in Visual Studio: I have a custom build.bat file with this content:

@echo off
mkdir w:\project\build
pushd w:\project\build
cl /Zi w:\project\code\win32_project.cpp user32.lib gdi32.lib
popd

Is there a way to integrate this into visual studio? Because currently, every time I want to test my program, I have to switch to the file explorer and run build.bat, then switch back to Visual Studio and click on "Start". Not a very ideal solution. The best would be if either I had a shortcut in Visual Studio I could press that'd run this file, or every time I clicked on Start it'd automatically run it for me. Are any of these doable?

You can add your batch file as part of a post build step.

In the project propertry pages open the build events tab and add your steps you wish to execute.

See here for more details

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM