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

WIP: accept dirafter as system arg to include_directories #3142

Closed
wants to merge 1 commit into from

Conversation

NickeZ
Copy link
Contributor

@NickeZ NickeZ commented Feb 26, 2018

This allows you to include directories after the system directories. Which means that you can have header files which have the same name as system headers and but not override them.

Not sure if this is the proper solution though. It should probably be an enum, (regular, system or dirafter).

Fixes #3141

[self.interpreter.backend.get_target_private_dir(self.held_object)]))
extra_build_dirs = [self.interpreter.backend.get_target_private_dir(self.held_object)]
return IncludeDirsHolder(
build.IncludeDirs('', [], False, False,
Copy link
Member

Choose a reason for hiding this comment

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

[Flake8]

[E126] continuation line over-indented for hanging indent

@NickeZ
Copy link
Contributor Author

NickeZ commented Feb 28, 2018

Btw, this could be useful to me for trying out meson with a really old project that has several such name clashes.

https://bugs.launchpad.net/epics-base/+bug/1563841

@NickeZ
Copy link
Contributor Author

NickeZ commented Mar 6, 2018

It seems like msvc has added support for system headers: https://blogs.msdn.microsoft.com/vcblog/2017/12/13/broken-warnings-theory/

@nirbheek
Copy link
Member

nirbheek commented Jun 3, 2018

This looks like a useful feature, will you be continuing work on this to get it out of WIP status?

@nirbheek nirbheek self-assigned this Jun 3, 2018
@NickeZ
Copy link
Contributor Author

NickeZ commented Jun 4, 2018

Sure if I can get some hints on what the API should look like. If the current one is OK I can take a look at it again and see if it is reviewable..

@nirbheek
Copy link
Member

nirbheek commented Jun 6, 2018

Two things:

  1. dir_after: might be easier to read
  2. We should probably warn when using these kwargs with a compiler that doesn't support the feature. Same for is_system:.

@bugaevc
Copy link

bugaevc commented Feb 28, 2020

I need this for a project of mine. @NickeZ would you revive this PR, or should I make a new one myself?

For the syntax, I would suggest include_directories('...', after_system: true)

@NickeZ
Copy link
Contributor Author

NickeZ commented Feb 28, 2020

@bugaevc feel free to pick it up. I don't have any time to work on this right now as I don't need it anymore.

@NickeZ NickeZ closed this Jun 15, 2022
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.

Unable to include files which share the same name as a system header
4 participants