-
-
Notifications
You must be signed in to change notification settings - Fork 617
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f6617c
commit 0d153f5
Showing
9 changed files
with
210 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
-- | ||
-- tests/actions/vstudio/cs2005/test_additional_props.lua | ||
-- Test the compiler flags of a Visual Studio 2005+ C# project. | ||
-- Copyright (c) 2012-2023 Jason Perkins and the Premake project | ||
-- | ||
|
||
local p = premake | ||
local suite = test.declare("vstudio_cs2005_additional_props") | ||
local dn2005 = p.vstudio.dotnetbase | ||
local project = p.project | ||
|
||
|
||
-- | ||
-- Setup and teardown | ||
-- | ||
|
||
local wks, prj | ||
|
||
function suite.setup() | ||
p.action.set("vs2005") | ||
wks, prj = test.createWorkspace() | ||
end | ||
|
||
local function prepare() | ||
local cfg = test.getconfig(prj, "Debug") | ||
dn2005.additionalProps(cfg) | ||
end | ||
|
||
|
||
-- | ||
-- Check handling of AdditionialProps. | ||
-- Elements specified at a time are sorted by name before placement. | ||
-- | ||
|
||
function suite.propsAreSorted() | ||
vsprops { | ||
Zzz = "zzz", | ||
Aaa = "aaa", | ||
Nullable = "enable", | ||
} | ||
prepare() | ||
test.capture [[ | ||
<Aaa>aaa</Aaa> | ||
<Nullable>enable</Nullable> | ||
<Zzz>zzz</Zzz> | ||
]] | ||
end | ||
|
||
|
||
-- | ||
-- Check handling of AdditionialProps. | ||
-- Element groups set multiple times are placed in the order in which they are set. | ||
-- | ||
|
||
function suite.multipleSetPropsAreNotSorted() | ||
vsprops { | ||
Zzz = "zzz", | ||
} | ||
vsprops { | ||
Aaa = "aaa", | ||
} | ||
vsprops { | ||
Nullable = "enable", | ||
} | ||
prepare() | ||
test.capture [[ | ||
<Zzz>zzz</Zzz> | ||
<Aaa>aaa</Aaa> | ||
<Nullable>enable</Nullable> | ||
]] | ||
end | ||
|
||
|
||
function suite.xmlEscape() | ||
vsprops { | ||
ValueRequiringEscape = "if (age > 3 && age < 8)", | ||
} | ||
prepare() | ||
test.capture [[ | ||
<ValueRequiringEscape>if (age > 3 && age < 8)</ValueRequiringEscape> | ||
]] | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
Add any property to your visual studio project | ||
This allows you to set properties that premake does not support without extending it | ||
|
||
Values set at one time are sorted alphabetically | ||
If you want to output groups of values in any order, set multiple times. | ||
|
||
```lua | ||
vsprops { | ||
Name1 = "value1", | ||
Name2 = "value2", | ||
} | ||
vsprops { | ||
Name3 = "value3", | ||
} | ||
``` | ||
|
||
### Parameters ### | ||
|
||
Name and value are strings | ||
|
||
### Availability ### | ||
|
||
Premake 5.0-beta3 or later. | ||
|
||
### Applies To ### | ||
|
||
The `config` scope. | ||
|
||
### Examples ### | ||
|
||
```lua | ||
language "C#" | ||
vsprops { | ||
-- https://devblogs.microsoft.com/visualstudio/vs-toolbox-accelerate-your-builds-of-sdk-style-net-projects/ | ||
AccelerateBuildsInVisualStudio = "true", | ||
-- https://learn.microsoft.com/en-us/visualstudio/ide/how-to-change-the-build-output-directory?view=vs-2022 | ||
AppendTargetFrameworkToOutputPath = "false", | ||
-- https://learn.microsoft.com/en-us/dotnet/csharp/tutorials/nullable-reference-types | ||
Nullable = "enable", | ||
} | ||
``` | ||
```lua | ||
language "C++" | ||
nuget { | ||
"Microsoft.Direct3D.D3D12:1.608.2" | ||
} | ||
vsprops { | ||
-- https://devblogs.microsoft.com/directx/gettingstarted-dx12agility/#2-set-agility-sdk-parameters | ||
Microsoft_Direct3D_D3D12_D3D12SDKPath = "custom_path", | ||
} | ||
``` |