Skip to content
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

Assure a default toolset is always set. #774

Merged
merged 2 commits into from
Jun 20, 2017

Conversation

tvandijck
Copy link
Contributor

@tvandijck tvandijck commented May 2, 2017

We're running into the issue where:

filter { 'toolset:msc-v140' }

doesn't work, because the majority of time, the toolset is not actually set. This change assures the filter always has a valid value in it, and not just 'nil' in the majority of cases.

We also normalize the toolset, so when you do

toolset 'v140'

it normalizes to msc-v140, as well as the other rules implemented in the p.tool.canonical function.
We should realy deprecate the v140 naming however, and require explicit msc-v140 usage, so I added a p.warnOnce in there too.

parts[2] = "LLVM-" .. parts[2]:sub(6)
end
end
p.warnOnce(identifier, "toolset '%s' is deprecated, toolset 'msc-%s' instead.", identifier, identifier)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"toolset '%s' is deprecated, toolset 'msc-%s' instead." should be "toolset '%s' is deprecated, use toolset 'msc-%s' instead." instead. (Added use after the comma) The line above shouldn't have the TODO anymore.

Also, I'm not sure this should be deprecated? It seems a bit arbitrary to require "msc-" to be prefixed to the value that VS will use and display. I'm happy for this to be merged in, but I'm concerned that new users will find this to be completely arbitrary.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was the original intention behind leaving the "v140" form in place: that matches what VS uses, and what you see in the IDE, so it is a more "expected" format if you're familiar with the VS projects. We did go back and forth on it though.

Copy link
Contributor Author

@tvandijck tvandijck May 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just put the deprecation message in there, because there is a comment that says "we should deprecate this"...

https://github.com/premake/premake-core/blob/master/src/base/tools.lua#L34

@tvandijck
Copy link
Contributor Author

tvandijck commented May 10, 2017

Removed the deprecation warning, but it still normalizes to "msc-v140", we could potentially remove that...
but in that case you can no longer reliably filter for it... since you would essentially have to write:

filter "toolset:v140 or msc-v140" 

since both are the same.
The alternative would be to normalize to 'v140', which is OK with me too. Either way, I think the normalization is key whichever way you go, so that filtering is stable.

@tvandijck
Copy link
Contributor Author

Removed the deprecation warning a while ago... need more feedback however on what direction we want to go for the normalization?

Copy link
Member

@starkos starkos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vote for the "msc-v140" approach.

@tvandijck tvandijck merged commit 0ce15ca into premake:master Jun 20, 2017
@tvandijck tvandijck deleted the default-toolset branch June 20, 2017 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants