-
-
Notifications
You must be signed in to change notification settings - Fork 620
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
Improve external include & warning support #1754
Conversation
Please add your new markdown pages to website/sidebar.js |
Out of scope of this PR, but how exactly should this be handled by other build systems? For build systems without this concept, should |
Note that msvc does nothing for |
I am the author of #1701. Unfortunately I can't continue working on premake for the next few months. However I want to point out that I think it is a bug in premake that sysincluddirs do not supress warnings in visual studio but do in gcc and clang. I wanted to address this as part of my PR. My idea was to make sysincludedirs behave the same on all systems so I don't need multiple instructions for the same behavior. But I am okay with closing my PR and going forward with this one. Any support for externalincludedirs is better than none. |
I guess I'd separate include paths I expect to exist on the build system (Windows SDK or glibc++, for example). And external would be dependencies of my application that aren't from the system, for example sqlite, freetype, or other third-party libraries that are external to my app but not part of the system. Maybe this distinction is moot or undesired, and that's fine I'm open to any solution that lets me tag file paths as external in MSVC so I can disable warnings when including them.
If I change this PR to fall back to sysincludedirs on other build systems then you will get the behavior you expect of this new instruction silencing warnings on all platforms. Is that a reasonable solution? |
I've had some time to dig into the implications of this as opposed to co-opting the existing API. As it currently stands, I don't think I'd want to accept the PR as-is (however I appreciate the work 😃). Below I've listed some of my research into the issue as well as what my take on the correct course of action is.
What do I propose?
This would have impacts on the API that already exists for Thoughts on this? |
+1 on this plan.
In favor of deprecating, but would probably not remove until v6 at this point, IMHO. Another option is to make |
I think this makes a lot of sense, I'll get that done.
I can make this change, but the reason I had them different originally is because I didn't want the same words with different meanings. For example, I also don't like
It is currently only used in vs project generation and ignored by other toolsets. Did you want me to do something different here? |
I don't have strong feelings on this, happy to do whatever people want here. It would probably mean less overall changes to keep |
For this, I think we should personally make the
So that's one option. Another option would be to register the API on the vstudio module. See this file: https://github.com/premake/premake-core/blob/master/modules/vstudio/_preload.lua |
OK I think I've addressed all the feedback at this point aside from deprecating |
My opinion about naming:
If we keep only if we deprecated |
Made changes to deprecate |
Are there additional changes people are interested in seeing here? |
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.
This looks good to me now. I've updated the PR title to be more accurate, and approving for merge.
@englercj Can you please rebase this against the latest main branch, and squash the commits? |
@starkos:
|
I did miss it, thanks for escalating. It looks like the value will get normalized to "msc-v143". |
Hey @starkos, just wanted to ping about this comment: #1754 (comment) I tried the method of comparing |
I'm not sure what to suggest here; I'm not the one who proposed using the toolset value. IMHO I'd go ahead and merge it as is, if you could do us the favor of rebasing your changing against the latest main branch. |
I suppose I hope it is only a Unit testing issue. (I will try to look at it this week-end). |
80822be
to
c71d7f8
Compare
Rebased and ready for merge. |
c71d7f8
to
e9db75b
Compare
Fixed the toolset check and squashed the commits onto latest master. I think we're good to go. |
Can't wait for this to be merged in 🙂 |
e9db75b
to
029acfc
Compare
029acfc
to
065b3ac
Compare
Rebased atop latest master, ready for merge AFAIK. |
Done, thanks! |
@englercj was there a reason why its only for visual studio 2022 and up? Externalincludes are supported in vs2019. |
@StellaASchlotter It was experimental in most versions of vs2019 and required the |
Ah thanks for this information. I was not aware of this. I will upgrade the VS version in my team then. |
What does this PR do?
Adds support for "external" headers to Visual Studio 2022. This adds three new APIs:
externalwarnings
- Controls warning levels for headers considered "external" (/external:Wn
,<ExternalWarningLevel>
)externalanglebrackets
- When set to "On" treats all headers included with angle brackets as "external" (/external:anglebrackets
,<TreatAngleIncludeAsExternal>
)externalincludedirs
- Include directory paths to treat as "external" (/external:Ipath
,<>
)This is a different take on this support than #1701. Here instead of repurposing
sysincludedirs
, I added a new concept ofexternalincludedirs
. I think these two things are fundamentally different as "external" in this context means "not part of my project" which doesn't necessarily mean "system". For example, I use these for some third-party non-system libraries, which I include using double quotes and not angle brackets.MSVC Docs: https://docs.microsoft.com/en-us/cpp/build/reference/external-external-headers-diagnostics?view=msvc-170
How does this PR change Premake's behavior?
Existing behavior should be unaffected, all new functionality is behind new APIs.
Anything else we should know?
Add any other context about your changes here.
closes #1692
Did you check all the boxes?
closes #XXXX
in comment to auto-close issue when PR is merged)