|
255 | 255 | flags { "ExcludeFromBuild" } |
256 | 256 | prepare() |
257 | 257 | test.capture [[ |
| 258 | +<ItemGroup> |
| 259 | + <None Include="hello.cpp" /> |
| 260 | +</ItemGroup> |
| 261 | + ]] |
| 262 | + end |
| 263 | + |
| 264 | + function suite.excludedFromBuild_onBuildActionNone() |
| 265 | + files { "hello.cpp" } |
| 266 | + filter "files:hello.cpp" |
| 267 | + buildaction "None" |
| 268 | + prepare() |
| 269 | + test.capture [[ |
| 270 | +<ItemGroup> |
| 271 | + <None Include="hello.cpp" /> |
| 272 | +</ItemGroup> |
| 273 | + ]] |
| 274 | + end |
| 275 | + |
| 276 | + function suite.excludedFromBuild_onBuildActionNone_Filtered() |
| 277 | + files { "hello.cpp" } |
| 278 | + filter { "files:hello.cpp", "configurations:Debug" } |
| 279 | + buildaction "None" |
| 280 | + prepare() |
| 281 | + test.capture [[ |
258 | 282 | <ItemGroup> |
259 | 283 | <ClCompile Include="hello.cpp"> |
260 | | - <ExcludedFromBuild>true</ExcludedFromBuild> |
| 284 | + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> |
261 | 285 | </ClCompile> |
262 | 286 | </ItemGroup> |
263 | 287 | ]] |
|
283 | 307 | flags { "ExcludeFromBuild" } |
284 | 308 | prepare() |
285 | 309 | test.capture [[ |
| 310 | +<ItemGroup> |
| 311 | + <None Include="hello.rc" /> |
| 312 | +</ItemGroup> |
| 313 | + ]] |
| 314 | + end |
| 315 | + |
| 316 | + function suite.excludedFromBuild_onResourceFile_buildActionNone() |
| 317 | + files { "hello.rc" } |
| 318 | + filter "files:hello.rc" |
| 319 | + buildaction "None" |
| 320 | + prepare() |
| 321 | + test.capture [[ |
| 322 | +<ItemGroup> |
| 323 | + <None Include="hello.rc" /> |
| 324 | +</ItemGroup> |
| 325 | + ]] |
| 326 | + end |
| 327 | + |
| 328 | + function suite.excludedFromBuild_onResourceFile_buildActionNone_Filtered() |
| 329 | + files { "hello.rc" } |
| 330 | + filter { "files:hello.rc", "configurations:Debug" } |
| 331 | + buildaction "None" |
| 332 | + prepare() |
| 333 | + test.capture [[ |
286 | 334 | <ItemGroup> |
287 | 335 | <ResourceCompile Include="hello.rc"> |
288 | | - <ExcludedFromBuild>true</ExcludedFromBuild> |
| 336 | + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> |
289 | 337 | </ResourceCompile> |
290 | 338 | </ItemGroup> |
291 | 339 | ]] |
|
298 | 346 | flags { "ExcludeFromBuild" } |
299 | 347 | prepare() |
300 | 348 | test.capture [[ |
| 349 | +<ItemGroup> |
| 350 | + <None Include="hello.rc" /> |
| 351 | +</ItemGroup> |
| 352 | + ]] |
| 353 | + end |
| 354 | + |
| 355 | + function suite.excludedFromBuild_onResourceFile_buildActionNone_nonWindows() |
| 356 | + files { "hello.rc" } |
| 357 | + system "Linux" |
| 358 | + filter "files:hello.rc" |
| 359 | + buildaction "None" |
| 360 | + prepare() |
| 361 | + test.capture [[ |
| 362 | +<ItemGroup> |
| 363 | + <None Include="hello.rc" /> |
| 364 | +</ItemGroup> |
| 365 | + ]] |
| 366 | + end |
| 367 | + |
| 368 | + function suite.excludedFromBuild_onResourceFile_buildActionNone_nonWindows_Filtered() |
| 369 | + files { "hello.rc" } |
| 370 | + system "Linux" |
| 371 | + filter { "files:hello.rc", "configurations:Debug" } |
| 372 | + buildaction "None" |
| 373 | + prepare() |
| 374 | + test.capture [[ |
301 | 375 | <ItemGroup> |
302 | 376 | <ResourceCompile Include="hello.rc"> |
303 | | - <ExcludedFromBuild>true</ExcludedFromBuild> |
| 377 | + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">true</ExcludedFromBuild> |
304 | 378 | </ResourceCompile> |
305 | 379 | </ItemGroup> |
306 | 380 | ]] |
|
355 | 429 | ]] |
356 | 430 | end |
357 | 431 |
|
358 | | - function suite.excludedFromBuild_onCustomBuildRule_withNoCommands() |
| 432 | + function suite.excludedFromBuild_onCustomBuildRule_buildActionNone() |
| 433 | + files { "hello.cg" } |
| 434 | + filter "files:**.cg" |
| 435 | + buildcommands { "cgc $(InputFile)" } |
| 436 | + buildoutputs { "$(InputName).obj" } |
| 437 | + buildaction "None" |
| 438 | + prepare() |
| 439 | + test.capture [[ |
| 440 | +<ItemGroup> |
| 441 | + <CustomBuild Include="hello.cg"> |
| 442 | + <FileType>Document</FileType> |
| 443 | + <ExcludedFromBuild>true</ExcludedFromBuild> |
| 444 | + <Command>cgc $(InputFile)</Command> |
| 445 | + <Outputs>$(InputName).obj</Outputs> |
| 446 | + </CustomBuild> |
| 447 | +</ItemGroup> |
| 448 | + ]] |
| 449 | + end |
| 450 | + |
| 451 | + function suite.excludedFromBuild_onCustomBuildRule_withNoCommands_excludeViaFlag() |
359 | 452 | files { "hello.cg" } |
360 | 453 | filter { "files:**.cg", "Debug" } |
361 | 454 | buildcommands { "cgc $(InputFile)" } |
|
375 | 468 | ]] |
376 | 469 | end |
377 | 470 |
|
| 471 | + function suite.excludedFromBuild_onCustomBuildRule_withNoCommands_buildActionNone() |
| 472 | + files { "hello.cg" } |
| 473 | + filter { "files:**.cg", "Debug" } |
| 474 | + buildcommands { "cgc $(InputFile)" } |
| 475 | + buildoutputs { "$(InputName).obj" } |
| 476 | + filter { "files:**.cg" } |
| 477 | + buildaction "None" |
| 478 | + prepare() |
| 479 | + test.capture [[ |
| 480 | +<ItemGroup> |
| 481 | + <CustomBuild Include="hello.cg"> |
| 482 | + <FileType>Document</FileType> |
| 483 | + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> |
| 484 | + <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">cgc $(InputFile)</Command> |
| 485 | + <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(InputName).obj</Outputs> |
| 486 | + </CustomBuild> |
| 487 | +</ItemGroup> |
| 488 | + ]] |
| 489 | + end |
| 490 | + |
378 | 491 |
|
379 | 492 | -- |
380 | 493 | -- If a custom rule outputs an object file, it's automatically linked, unless |
|
0 commit comments