-
-
Notifications
You must be signed in to change notification settings - Fork 618
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
Add C11 flag support for GCC #659
Conversation
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 can't really see any reason not to merge this after we merged the other C flags. Would be good to one day have an API instead, like we've done for other flags.
It would be great to get these moved to an API. Flags are bad enough, but multiple flags that compete with each other are the worst. |
Let's merge this right now, and I'll have a look this month (now that I'm back from vacation) at moving these things into a proper API.. |
What happened to the discussion about using existing language API to support dialects? language "C"
language "C11"
language "C++"
language "C++14" Etc... ? (I was actually against this at one point... but I thought it was more-or-less agreed at that time?) |
I don't recall seeing this, may have been before my time, but I do recall seeing this for the |
I can't find the original discussion. The idea was to merge the language and the standard variant into one token, e.g. As far as I know, no work has been done it so far. |
@samsinsane It was well before your time ;) |
@TurkeyMan Ahh, the curses of youth. :P @starkos On the other hand, |
GNU++14 is a C++ language standard, so I would expect |
I'm kind of in favor of the "language" modification... but it's a lot harder to keep that backwards compatible with the current flags. |
this is a problem..... that will have to move to the config scope, if we go that route...
for example... what is the visual studio backend going to do with that?
or something like that. Adding a 'standard' or 'languagestandard' keyword is going to be a lot easier. What is indeed somewhat strange is that that could lead to language 'd', standard 'c++14', which makes no sense..
that would allow us to validate it based on prior settings... all this however, adds quite a bit of complexity to premake as a whole... Although I have in the past ran into similar requirements, so it would be a welcome addition. |
Only a little time here, but...
Agreed. You can already specify a mix of C and C++ files within a project.
Our choice. It can silently fall back to generic C++, raise a warning and fallback to C++, or error. For the sake of this discussion, the problem exists with both approaches (i.e. what would VS do with
There is no way to get a meaningful value for |
good point indeed... although at the same time... if I move it to a config scope, it won't ever have a meaning full value... since it is no longer a single value for the project. While it makes no sense from a usefulness point of view, this would now be legal premake: filter { "debug" }
language "C++11"
files { '*.cpp' }
filter { "release" }
language "C#"
files { '*.cs' } so what is this code going to do now? if premake.project.isdotnet(prj) then
premake.generate(prj, ".csproj", vstudio.cs2005.generate)
elseif premake.project.iscpp(prj) then
premake.generate(prj, ".vcproj", vstudio.vc200x.generate) We need some form of validation that the input is sensible.. |
Maybe something like this? :) |
yeah, exactly like that ;) I'll experiment a little with that this week then... |
It might not be that bad. I would deprecate the flags, but not try to translate them to the equivalent language. Instead, just test for both language and flag everywhere they are used. So in our GNU configmap, for instance, you might have (very off the top of my head, untested):
Probably will also want a table to map these to generic values for
|
I gave this a shot here |
Fixes #642