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

Meson does not respect target_include_directories(PRIVATE) in CMake subprojects #13818

Open
artem opened this issue Oct 23, 2024 · 0 comments
Open
Labels
bug good first issue module:cmake Issues related to the cmake module, including cmake.subproject

Comments

@artem
Copy link

artem commented Oct 23, 2024

Describe the bug
target_include_directories(libfoo PRIVATE) implies that these private headers will not be propagated to the user of the libfoo.

To Reproduce
https://github.com/artem/meson-bug-demo/tree/cmake-module branch cmake-module

Expected behavior
test.c does not see private-include/private.h

Autogenerated meson.build by the cmake module:

project('meow', 'c')
libmeow_dir = include_directories('private-include', 'public-include', '__CMake_build', '.')
libmeow_sys = include_directories(is_system : true)
libmeow_inc = [libmeow_dir, libmeow_sys]
libmeow_src = files('meow.c')
libmeow = static_library(
  'libmeow',
  libmeow_src,
  build_by_default : false,
  link_args : [],
  link_with : [],
  include_directories : libmeow_inc,
  install : false,
  override_options : [],
  objects : [],
  c_args : [],
  pic : false
)
libmeow_dep = declare_dependency(
  link_args : [],
  link_with : libmeow,
  compile_args : [],
  include_directories : libmeow_inc
)

system parameters

  • meson 1.3.2
  • ninja 1.11.1

P.S. Relevant meson code from master branch: https://github.com/mesonbuild/meson/blob/7813354/mesonbuild/cmake/interpreter.py#L1171-L1175

@dcbaker dcbaker added bug module:cmake Issues related to the cmake module, including cmake.subproject good first issue labels Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue module:cmake Issues related to the cmake module, including cmake.subproject
Projects
None yet
Development

No branches or pull requests

2 participants