Compile the vs project with the command line

前言

see the data, you can use the devenv.com to compile the vs project and do an experiment.   If you have compiled the vs project with IDE, you can compile the vs project with the command line.   Compiling the vs project with the command line can automate the compilation process.

实验

@echo off

rem @file build_prj.cmd
rem @brief build vs project with vs2017 command lines
rem @note Compile with IDE first, then compile with command line

set DEVENV_COM="C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.com"
set SLN_NAME_1="D:\ls\study\capture_packet\src\capture_packet_on_loop_back_adapter\src\dy_load_wpcap_dll\dy_load_wpcap_dll.sln"
set PRJ_NAME_1="dy_load_wpcap_dll"
set PRJ_CFG_RELEASE_WIN32="Release|Win32"
set LOG_FILE_NAME="d:\my_tmp\vs_cmd_build.log"
set TIP_BEGIN=build begin, please wait ...
set TIP_END=build end

rem echo DEVENV_COM = %DEVENV_COM%
rem %DEVENV_COM% --help

echo %TIP_BEGIN%
%DEVENV_COM% %SLN_NAME_1% /build %PRJ_CFG_RELEASE_WIN32% /project %PRJ_NAME_1% > %LOG_FILE_NAME%
echo %TIP_END%

rem print a empty line
echo.
pause