Skip to content

Cannot disable RTTI under the Visual Studio backend #13973

Open
@kridenberg

Description

@kridenberg

Describe the bug
While trying to generate a project with VS2022 and VS2019 backend I noticed that cpp_rtti does not take any effect for VS backend at all. This is also reproducible with the Clang-CL (clang 19.1.4) compiler as well. Any attempt to attach /GR- option directly does not work (or maybe I do not realise for now how to do it properly)

Additionally, I do not know if this is a bug or a design decision, but the VS backend does not take into account c_std and cpp_std options if there is no file to compile with those compilers. For example, in the attached zip c_std option is not set for the VS backend, because there are no sources to compile with the C compiler.

To Reproduce

  1. Open Developer Command Prompt for VS2022
  2. Execute "meson setup build --backend vs2022" or "CC=clang-cl CXX=clang-cl meson setup build --backend vs2022"

Expected behavior
Options are applied as expected. RTTI is disabled and the C standard is set to the 17 version.

system parameters
Platin native build.
OS: Windows 11
Python: 3.11.9
Meson version: tested on 1.6.99 (latest git at that moment) and 1.6.0 (from pip)

Zip archive with meson.build and source.cpp file:
test.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions