Skip to content
This repository has been archived by the owner on Aug 30, 2020. It is now read-only.

meson/ninja generator creates incorrect include paths #117

Open
Philipp-M opened this issue Feb 24, 2018 · 1 comment
Open

meson/ninja generator creates incorrect include paths #117

Philipp-M opened this issue Feb 24, 2018 · 1 comment

Comments

@Philipp-M
Copy link

when generating with a trivial meson build file:

project('OctreeOOConverter', 'cpp',
  default_options : ['c_std=c17', 'cpp_std=c++17'])
inc = include_directories('inc')
src = ['src/main.cpp']
exe = executable('OctreeOOConverter', src, include_directories : inc)

the following flags are generated:

flags = [
    '-x',
    'c++',
    '-D_FILE_OFFSET_BITS=64',
    '-I.',
    '-I../../home/philm/Development/rayTracing/OctreeOOConverter',
    '-I../../home/philm/Development/rayTracing/OctreeOOConverter/inc',
    '-IOctreeOOConverter@exe',
    '-Wall',
    '-Winvalid-pch',
    '-Wnon-virtual-dtor',
    '-std=c++17',
]

as one can see, the file paths are incorrect and are not working with YCM
they should be the following:

flags = [
    ...
    '-I/home/philm/Development/rayTracing/OctreeOOConverter',
    '-I/home/philm/Development/rayTracing/OctreeOOConverter/inc',
    ...
]
@rdnetto
Copy link
Owner

rdnetto commented Feb 26, 2018

This happens because the project is compiled out-of-tree in a temporary directory. Meson appears to generate relative paths to the files, unlike Cmake which uses absolute paths.

Short of configuring Meson to use absolute paths, there's no easy fix for this, besides manually fixing up the generated flags.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants