-
-
Notifications
You must be signed in to change notification settings - Fork 619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow adding any property to a VisualStudio project #2112
Conversation
function dotnetbase.additionalProps(cfg) | ||
for i = 1, #cfg.props do | ||
for key, value in spairs(cfg.props[i]) do | ||
_p(2, '<%s>%s</%s>', key, value, key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonder if we have a xml escaper for value
...
It seems not according to above function (which is more likely to have <
or >
.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are multiple xml escaping functions, which one should I use?
For now, I use vs2005.esc
for csharp, vs2010.esc
for c++
website/docs/props.md
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if order is important for msvc, adding in the doc the way to specify order (several calls) should be added IMO.
else that sentence can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it to the document because it is sometimes necessary to specify the order when reusing properties defined before.
By the way, the reason for sorting by name is that the order of the lua table is not always the same.
src/_premake_init.lua
Outdated
@@ -1062,6 +1062,13 @@ | |||
kind = "list:table", | |||
} | |||
|
|||
api.register { | |||
name = "props", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the name should not reflect that it is visual specific (vsprops
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to vsprops
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Late to the party, but can this life in modules/vstudio/_preload.lua
instead, since it's specific to VS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing this out. I have moved the definition to modules/vstudio/_preload.lua
.
0dfc5f5
to
67de2d1
Compare
2221460
to
9b9f3ca
Compare
e957529
to
e79b1d8
Compare
e79b1d8
to
13a5db3
Compare
13a5db3
to
0d153f5
Compare
I think this needs to be added in the sidebar still. Other than that, I think I'm happy with the code (though a merge conflict needs to be resolved, if you could do that, it would be very appreciated). |
0d153f5
to
54af123
Compare
@nickclark2016 |
Please add |
premake-core/website/sidebars.js Lines 291 to 294 in 54af123
->
|
54af123
to
6b31b30
Compare
What does this PR do?
At #2025 I was able to use the nuget package from Microsoft.Direct3D.D3D12.
But to parameterize this package, we need to set properties such as Microsoft_Direct3D_D3D12_D3D12SDKPath and Microsoft_Direct3D_D3D12_SkipLibraryCopy etc.
Also in charp, we need to set properties for nullable and other settings.
Instead of creating dedicated functions for each of these settings, I would like to create a single function that can set any property.
How does this PR change Premake's behavior?
Add a
props
command to allow setting arbitrary propertiesAnything else we should know?
no
Did you check all the boxes?
closes #XXXX
in comment to auto-close issue when PR is merged)You can now support Premake on our OpenCollective. Your contributions help us spend more time responding to requests like these!