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

Bad order of include directories for C++ when using is_system: true #10399

Open
mkow opened this issue May 15, 2022 · 0 comments
Open

Bad order of include directories for C++ when using is_system: true #10399

mkow opened this issue May 15, 2022 · 0 comments

Comments

@mkow
Copy link

mkow commented May 15, 2022

Describe the bug

Seems to be the same bug as #7654, but in C++ and only for directories passed with is_system: true - they end up being passed to the compiler in reversed order.

To Reproduce

project(
    'Some project name',
    'c', 'cpp',
    version: '1.0',
    meson_version: '>=0.55',
    default_options: [
        'c_std=c11',
        'cpp_std=c++14',
    ],
)
includes = [
    include_directories('/A'),
    include_directories('/B'),
    include_directories('/C', is_system: true),
    include_directories('/D', is_system: true),
    include_directories('/E', is_system: true),
]
sources = [
    'main.cpp',
]
shared_library('some-project-name',
    sources,
    include_directories: includes,
)

Compiling this project results in the following compiler invocation: (note the system includes)
ccache c++ -Ilibsome-project-name.so.p -I. -I.. -I/A -I/B -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++14 -O0 -g -fPIC -isystem/E -isystem/D -isystem/C -MD -MQ libsome-project-name.so.p/main.cpp.o -MF libsome-project-name.so.p/main.cpp.o.d -o libsome-project-name.so.p/main.cpp.o -c ../main.cpp

Expected behavior

System headers should be specified in the same order as provided in include_directories.

system parameters

  • plain native build (meson setup build/; meson compile -C build/)
  • Ubuntu 20.04
  • Python 3.8.10
  • meson --version: 0.62.1
  • ninja --version: 1.10.0
@mkow mkow changed the title Bad order of include directories for C++ when using -isystem Bad order of include directories for C++ when using is_system: true May 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

No branches or pull requests

1 participant