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

Building library using 'meson compile <target>:shared_library' fails when name_suffix is used #13974

Open
pdedecker opened this issue Nov 30, 2024 · 0 comments

Comments

@pdedecker
Copy link

Describe the bug
I'm developing a shared library using the Mesonbuild extension in Visual Studio code. My library needs to have a custom extension, which I include using the 'name_suffix' key. The build fails. Commenting out the name_suffix key fixes it.

To Reproduce
Here's a minimal example:

project('testit', 'cpp',
  version : '0.1',
  default_options : ['warning_level=3', 'cpp_std=c++14'])

library('testit',
  'testit.cpp',
  name_suffix : 'xop',
  install : true)

The VS code extension will try to build by running

> meson compile testit:shared_library
INFO: autodetecting backend as ninja

ERROR: Can't invoke target `testit:shared_library`: target not found

This is reproducible also from the terminal. Omitting the trailing ':shared_library' will fix it:

> meson compile testit
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: C:\Users\peter\scoop\shims\ninja.EXE testit.xop
[2/2] Linking target testit.xop
   Creating library testit.lib and object testit.exp

The build can also be fixed by commenting out the name_suffix : 'xop', line in the meson.build.

Expected behavior
The build should work regardless of whether the 'name_suffix' key is present or not.

system parameters

  • Native build on Windows 10
  • Using X64 native tools command prompt for VS 2022
  • Meson 1.6.0
  • Ninja 1.12.1
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