• msbuild 编译指定工程时构建脚本的配置


    有时候 ,我们编译windows的exe时,我们不需要编译所有的工程,我们只需要指定某个工程就好了,此时我们使用/t:工程名:Rebuild(如果要编译全部工程就把工程名去掉,即/t:Rebuild)

    具体如下:

    set msbuild="C:Program Files (x86)MSBuild14.0Binmsbuild.exe"

    set command_part=/t:PCCast2:Rebuild 

    set sln_file=%cur_path%ToB-Win-App.sln

    set vcvars="%VS2015_HOME%VCvcvarsall.bat"

    echo "=====================set %platform% env========================"
    if "%platform%"=="x86" call %vcvars% x86
    if "%platform%"=="x64" call %vcvars% x86_amd64

    :: build type, debug or release
    set type_tmp=%1

    if "%type_tmp%" == "Release_Static" (
    echo "++++++++++++++++++++++it is Release Static+++++++++++++++++++"
    set type="Release Static"
    )else if "%type_tmp%" == "Debug_Static" (
    echo "++++++++++++++++++++++it is Debug Static+++++++++++++++++++++++"
    set type="Debug Static"
    )else (
    echo "++++++++++++++++++++++++change type+++++++++++++++++++++++++++++"
    set type=%type_tmp%
    )

    %msbuild% %sln_file% %command_part% /p:Configuration=%type%;Platform=%platform% 

    
    
    
    

    参考:

    https://docs.microsoft.com/zh-cn/visualstudio/msbuild/how-to-build-specific-targets-in-solutions-by-using-msbuild-exe?view=vs-2015

  • 相关阅读:
    linux 6 安装 Nagios服务
    linux 6 安装 Nginx服务
    Rsync的配置与使用
    linux 6 搭建 msyql 服务
    linux6搭建Apache服务
    Linux 7搭建NFS服务
    Linux 6 忘记root密码重置
    简单makefile
    多线程c++11编程题目
    redis 代码结构与阅读顺序
  • 原文地址:https://www.cnblogs.com/zndxall/p/10502089.html
Copyright © 2020-2023  润新知