|
| 1 | +// universal configuration pivots. |
| 2 | + |
| 3 | +configurations { |
| 4 | + Toolsets { |
| 5 | + key : "PlatformToolset"; |
| 6 | + choices: { v120, v110, v100, v90, v80, v71, v70, v60, gcc, v110_xp, v110_wp80, v120_xp, v120_wp80, v120_wp81 }; |
| 7 | + |
| 8 | + v110_wp80 { |
| 9 | + accept : { x86, arm, WindowsPhone8 }; |
| 10 | + |
| 11 | + isInstalled : { |
| 12 | + FileExists="c:\invalid_file.xyz"; |
| 13 | + }; |
| 14 | + }; |
| 15 | + |
| 16 | + v110_xp { |
| 17 | + accept : { Win32, x64, Desktop }; |
| 18 | + |
| 19 | + isInstalled : { |
| 20 | + FileExists="c:\invalid_file.xyz"; |
| 21 | + }; |
| 22 | + }; |
| 23 | + |
| 24 | + v120_wp80 { |
| 25 | + accept : { x86, arm, WindowsPhone8 }; |
| 26 | + |
| 27 | + isInstalled : { |
| 28 | + FileExists="c:\invalid_file.xyz"; |
| 29 | + }; |
| 30 | + }; |
| 31 | + |
| 32 | + |
| 33 | + v120_wp81 { |
| 34 | + accept : { x86, arm, WindowsPhone8 }; |
| 35 | + |
| 36 | + isInstalled : { |
| 37 | + FileExists="c:\invalid_file.xyz"; |
| 38 | + }; |
| 39 | + }; |
| 40 | + |
| 41 | + v120_xp { |
| 42 | + accept : { Win32, x64, Desktop }; |
| 43 | + |
| 44 | + isInstalled : { |
| 45 | + FileExists="c:\invalid_file.xyz"; |
| 46 | + }; |
| 47 | + }; |
| 48 | + |
| 49 | + gcc { |
| 50 | + accept : { Win32, x64, Desktop }; |
| 51 | + |
| 52 | + isInstalled : { |
| 53 | + FileExists="c:\invalid_file.xyz"; |
| 54 | + }; |
| 55 | + }; |
| 56 | + |
| 57 | + v60 { |
| 58 | + accept : { Win32, Desktop }; |
| 59 | + |
| 60 | + isInstalled : { |
| 61 | + FileExists="c:\invalid_file.xyz"; |
| 62 | + }; |
| 63 | + }; |
| 64 | + |
| 65 | + v70 { |
| 66 | + accept : { Win32, Desktop }; |
| 67 | + |
| 68 | + isInstalled : { |
| 69 | + FileExists="c:\invalid_file.xyz"; |
| 70 | + }; |
| 71 | + }; |
| 72 | + |
| 73 | + v71 { |
| 74 | + accept : { Win32, x64, Desktop }; |
| 75 | + |
| 76 | + isInstalled : { |
| 77 | + FileExists="c:\invalid_file.xyz"; |
| 78 | + }; |
| 79 | + }; |
| 80 | + |
| 81 | + v80 { |
| 82 | + accept : { Win32, x64, Desktop }; |
| 83 | + |
| 84 | + isInstalled : { |
| 85 | + FileExists="c:\invalid_file.xyz"; |
| 86 | + }; |
| 87 | + }; |
| 88 | + |
| 89 | + v90 { |
| 90 | + accept : { Win32, x64, Desktop }; |
| 91 | + |
| 92 | + isInstalled : { |
| 93 | + FileExists="c:\invalid_file.xyz"; |
| 94 | + }; |
| 95 | + }; |
| 96 | + |
| 97 | + v100 { |
| 98 | + accept : { Win32, x64, Desktop }; |
| 99 | + |
| 100 | + isInstalled : { |
| 101 | + FileExists="C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"; |
| 102 | + }; |
| 103 | + |
| 104 | + activate { // generates an 'activate_v100' Target when used from the invoke-build cmdlet. |
| 105 | + .GetEnvironmentFromBatchFile { |
| 106 | + BatchFile="C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"; |
| 107 | + Parameters="${Platform}"; |
| 108 | + }; |
| 109 | + }; |
| 110 | + }; |
| 111 | + |
| 112 | + v110 { |
| 113 | + // We're normalizing out the concept of the v110 platform -- Overloading the $(PlatformToolset) variable for additional pivots was a dumb idea. |
| 114 | + condition = "( '$(PlatformToolset.ToLower())' == 'v110' Or '$(PlatformToolset.ToLower())' == 'windowskernelmodedriver8.0' Or '$(PlatformToolset.ToLower())' == 'windowsapplicationfordrivers8.0' Or '$(PlatformToolset.ToLower())' == 'windowsusermodedriver8.0' )"; |
| 115 | + deny : { AnyCPU }; |
| 116 | +
|
| 117 | + isInstalled : { |
| 118 | + FileExists="C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"; |
| 119 | + }; |
| 120 | +
|
| 121 | + activate { |
| 122 | + .GetEnvironmentFromBatchFile { |
| 123 | + BatchFile="C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"; |
| 124 | + Parameters=${Platform}; //.Replace(arm,x86_arm) |
| 125 | + }; |
| 126 | + }; |
| 127 | + }; |
| 128 | +
|
| 129 | + v120 { |
| 130 | + // We're normalizing out the concept of the v120 platform -- Overloading the $(PlatformToolset) variable for additional pivots was a dumb idea. |
| 131 | + condition = "( '$(PlatformToolset.ToLower())' == 'v120' Or '$(PlatformToolset.ToLower())' == 'windowskernelmodedriver8.0' Or '$(PlatformToolset.ToLower())' == 'windowsapplicationfordrivers8.0' Or '$(PlatformToolset.ToLower())' == 'windowsusermodedriver8.0' )"; |
| 132 | + deny : { AnyCPU }; |
| 133 | + |
| 134 | + isInstalled : { |
| 135 | + FileExists="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"; |
| 136 | + }; |
| 137 | + |
| 138 | + activate { |
| 139 | + .GetEnvironmentFromBatchFile { |
| 140 | + BatchFile="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"; |
| 141 | + Parameters=${Platform}; //.Replace(arm,x86_arm) |
| 142 | + }; |
| 143 | + }; |
| 144 | + }; |
| 145 | + |
| 146 | + |
| 147 | + }; |
| 148 | + |
| 149 | + Platforms { |
| 150 | + key : "Platform"; |
| 151 | + choices: { Win32, x64, ARM, AnyCPU }; |
| 152 | + Win32 { |
| 153 | + aliases : { x86, win32, ia32, 386 }; |
| 154 | + }; |
| 155 | + |
| 156 | + x64 { |
| 157 | + aliases : { x64, amd64, em64t, intel64, x86-64, x86_64 }; |
| 158 | + accept: { cdecl, vectorcall }; |
| 159 | + }; |
| 160 | + |
| 161 | + ARM { |
| 162 | + aliases : { arm, woa }; |
| 163 | + accept : { cdecl }; |
| 164 | + }; |
| 165 | + |
| 166 | + AnyCPU { |
| 167 | + aliases : { anycpu, any }; |
| 168 | + }; |
| 169 | + }; |
| 170 | + |
| 171 | + Configurations { |
| 172 | + key : "Configuration"; |
| 173 | + choices: { Release, Debug }; |
| 174 | + |
| 175 | + Release { |
| 176 | + condition = "( $(Configuration.ToLower().IndexOf('debug')) == -1 )"; |
| 177 | + }; |
| 178 | + |
| 179 | + Debug { |
| 180 | + condition = "( $(Configuration.ToLower().IndexOf('debug')) > -1 )"; |
| 181 | + }; |
| 182 | + }; |
| 183 | + |
| 184 | + Linkages { |
| 185 | + choices : { dynamic, static, ltcg, sxs }; |
| 186 | + description = "Which version of the .lib file to link to this library"; |
| 187 | + |
| 188 | + ltcg { |
| 189 | + description = "Link Time Compiler Generation"; |
| 190 | + }; |
| 191 | + |
| 192 | + dynamic { |
| 193 | + description = "Dynamic Library (DLL)"; |
| 194 | + }; |
| 195 | + |
| 196 | + static { |
| 197 | + description = "Static"; |
| 198 | + }; |
| 199 | + |
| 200 | + sxs { |
| 201 | + description = "Side-by-Side"; |
| 202 | + }; |
| 203 | + |
| 204 | + }; |
| 205 | + |
| 206 | + // Only really applicable to x86 |
| 207 | + CallingConventions { |
| 208 | + choices : { cdecl, stdcall, fastcall, thiscall, clrcall, vectorcall }; |
| 209 | + description = "Calling convention model to use"; |
| 210 | + |
| 211 | + cdecl { |
| 212 | + description = "cdecl"; |
| 213 | + }; |
| 214 | + |
| 215 | + stdcall { |
| 216 | + description = "stdcall (Uncommon)"; |
| 217 | + accept: { Win32 }; |
| 218 | + }; |
| 219 | + |
| 220 | + fastcall { |
| 221 | + description = "fastcall (Rare)"; |
| 222 | + accept: { Win32 }; |
| 223 | + }; |
| 224 | + |
| 225 | + thiscall { |
| 226 | + description = "thiscall (Rare)"; |
| 227 | + accept: { Win32 }; |
| 228 | + }; |
| 229 | + |
| 230 | + clrcall { |
| 231 | + description = "clrcall (Rare)"; |
| 232 | + accept: { Win32 }; |
| 233 | + }; |
| 234 | + |
| 235 | + vectorcall { |
| 236 | + accept: { v120, x64, x86 }; |
| 237 | + } |
| 238 | + }; |
| 239 | + |
| 240 | + CharacterSets { |
| 241 | + key : "CharacterSet"; |
| 242 | + choices: { MultiByte, Unicode }; |
| 243 | + }; |
| 244 | + |
| 245 | + /* |
| 246 | + Since the MSBuild property for identifying if a project is compiling a Win8 Store App |
| 247 | + is a boolean, and we don't want to actually key off that, we're going to generate |
| 248 | + a property that gets a value based on that boolean, and key off of that. |
| 249 | + |
| 250 | + We'll declare that property in the props file (so that it happens early in the MSBuild) |
| 251 | + (see the props section down near the bottom) |
| 252 | + */ |
| 253 | +
|
| 254 | + TargetApplicationTypes { |
| 255 | + key: "TargetApplicationType"; |
| 256 | + |
| 257 | + choices: { Desktop, WinRT, Phone8, KernelModeDriver, ApplicationForDriver, UserModeDriver }; // "WindowsKernelModeDriver8.0", "WindowsApplicationForDrivers8.0", "WindowsUserModeDriver8.0" |
| 258 | + |
| 259 | + #defines { |
| 260 | + // we are going to define the conditions here |
| 261 | + // so that we can reuse them to detect 'desktop', since it's the absence |
| 262 | + // of all others, and I don't want to accidentally make a copy/paste error. |
| 263 | +
|
| 264 | + KernelModeDriver_condition = "('$(PlatformToolset.ToLower())' == 'windowskernelmodedriver8.0')"; |
| 265 | + ApplicationForDriver_condition = "('$(PlatformToolset.ToLower())' == 'windowsapplicationfordrivers8.0')"; |
| 266 | + UserModeDriver_condition = "('$(PlatformToolset.ToLower())' == 'windowsusermodedriver8.0')"; |
| 267 | +
|
| 268 | + Phone8_condition = "('$(TargetPlatformIdentifier.ToLower())' == 'windows phone' And '$(TargetPlatformVersion)' >= '8.0')"; |
| 269 | + WinRT_condition = "('$(AppContainerApplication.ToLower())' == 'true')"; |
| 270 | + Desktop_condition = "( !${KernelModeDriver_condition} And !${ApplicationForDriver_condition} And !${UserModeDriver_condition} And !${Phone8_condition} And !${WinRT_condition} )"; |
| 271 | + } |
| 272 | +
|
| 273 | + Desktop { |
| 274 | + aliases : { Desktop, NotWinRT }; |
| 275 | + condition = ${Desktop_condition}; |
| 276 | + }; |
| 277 | +
|
| 278 | + WinRT { |
| 279 | + aliases : { WinRT, Metro, Modern }; |
| 280 | + condition = ${WinRT_condition}; |
| 281 | + accept : { v120, v110 }; |
| 282 | + }; |
| 283 | +
|
| 284 | + Phone8 { |
| 285 | + aliases : { Phone8, Phone, WindowsPhone }; |
| 286 | + condition = ${Phone8_condition}; |
| 287 | + accept : { v120, v110 }; |
| 288 | + }; |
| 289 | + |
| 290 | + KernelModeDriver { |
| 291 | + aliases : { KernelModeDriver, Kernel, KernelDriver ,Driver }; |
| 292 | + condition = ${KernelModeDriver_condition}; |
| 293 | + accept : { v120, v110 }; |
| 294 | + }; |
| 295 | +
|
| 296 | + ApplicationForDriver { |
| 297 | + aliases : { ApplicationForDriver }; |
| 298 | + condition = ${ApplicationForDriver_condition}; |
| 299 | + accept : { v120, v110 }; |
| 300 | + }; |
| 301 | +
|
| 302 | + UserModeDriver { |
| 303 | + aliases : { UserModeDriver, UserMode, UserDriver }; |
| 304 | + condition = ${UserModeDriver_condition}; |
| 305 | + accept : { v120, v110 }; |
| 306 | + }; |
| 307 | +
|
| 308 | + } |
| 309 | +} |
0 commit comments