How can I pass a parameter through MSBuild to the compiler?

后端 未结 2 2053
广开言路
广开言路 2020-12-18 02:10

I\'m using the line below to have MSBuild build a Delphi 2010 groupproj:

   MSBuild C:\\src\\myprojgroup.groupproj  /target:Build /p:config=Release
         


        
2条回答
  •  生来不讨喜
    2020-12-18 02:53

    Change your build configuration within Delphi, or manually yourself in the .DPROJ file. If you change the Release config itself in either of those places, you'll be fine.

    Alternately, look at the .dproj file and see what the setting you want is called (eg., "IncludePath" or "OutputDir"). You can then use msbuild's /property switch. For example:

    msbuild /property:WarningLevel-2;OutputDir=bin\Debug myproj.dproj
    

    You can see these command-line switches and examples using the following from a command window prompt:

    msbuild /? | more
    

    A quick check of a .dproj file from D2007 indicates you're probably looking for either the DCC_IncludePath or DCC_UnitSearchPath properties.

提交回复
热议问题