mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.6k stars 1.63k forks source link

include_directories() is apparently filtering? #7296

Open phillipjohnston opened 4 years ago

phillipjohnston commented 4 years ago

Describe the bug

I maintain a libc and libcpp for use with microcontroller-based embedded projects. I compile with -nostdinc/-nostdinc++ to prevent picking up the compiler's builtin library. For supporting testing/simulation on a PC, I want to manually re-add some system includes as needed while ensuring proper ordering.

When I try this:

thread_host_include_directories = include_directories(
    darwin_sdk_path + '/usr/include/',
    is_system: true)

Meson does not add the include argument to the build. If I remove is_system: true, the include argument is added.

To Reproduce

Using OS X with Apple Clang, you can build the pj/debug branch of our libcpp project: https://github.com/embeddedartistry/libcpp/tree/pj/debug

Expected behavior

Meson adds the include directory.

system parameters

phillipjohnston commented 4 years ago

I also tried manually adding the -isystem compiler flag (via cpp_args on the library target), and it does not appear. It does appear if I use -I and -idirafter when specifying the flag.

phillipjohnston commented 4 years ago

Just wanted to follow up on this: is there any way to disable the include directory filtering?

seeseemelk commented 1 year ago

I just ran into the same issue. Specifying --nostdinc -isystem /path/to/some/dir -isystem /usr/include results in gcc being executed with --nostdinc -isystem /path/to/som/dir. That means header files in /usr/include are no longer being picked up.