-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Milestone
Description
Describe the bug
When building project using multiple c_std value with clang-cl, the resulting compiler option is invalid.
To Reproduce
create empty file testma.cpp
create: meson.build:
project('testma', 'cpp', default_options: ['cpp_std=c++latest'])
miniaudio = dependency('miniaudio')
executable('testma', ['testma.cpp'], dependencies: [miniaudio])
In Visual Studio developer environment with clang, do:
mkdir subprojects
meson wrap install miniaudio
set CC=clang-cl
set CXX=clang-cl
meson setup build
The resulting build/build.ninja contains invalid options "/clang:-std=gnu11,c11,gnu99,c99,gnu89,c89". For example:
build subprojects/miniaudio-0.11.22/extras/nodes/libma_channel_combiner_node.a.p/ma_channel_combiner_node_ma_channel_combiner_node.c.obj: c_COMPILER ../subprojects/miniaudio-0.11.22/extras/nodes/ma_channel_combiner_node/ma_channel_combiner_node.c
DEPFILE = "subprojects\miniaudio-0.11.22\extras\nodes\libma_channel_combiner_node.a.p\ma_channel_combiner_node_ma_channel_combiner_node.c.obj.d"
DEPFILE_UNQUOTED = subprojects\miniaudio-0.11.22\extras\nodes\libma_channel_combiner_node.a.p\ma_channel_combiner_node_ma_channel_combiner_node.c.obj.d
ARGS = "-Isubprojects\miniaudio-0.11.22\extras\nodes\libma_channel_combiner_node.a.p" "-Isubprojects\miniaudio-0.11.22" "-I..\subprojects\miniaudio-0.11.22" "/MDd" "/nologo" "/showIncludes" "/utf-8" "/W4" "/clang:-std=gnu11,c11,gnu99,c99,gnu89,c89" "/Od" "/Zi" "/Fdsubprojects\miniaudio-0.11.22\extras\nodes\libma_channel_combiner_node.a.p\ma_channel_combiner_node_ma_channel_combiner_node.c.pdb"
Note that the subprojects\miniaudio-0.11.22\meson.build contains:
project(
...
default_options: [
...
'c_std=gnu11,c11,gnu99,c99,gnu89,c89',
],
)
Expected behavior
Meson selects only one C standard, and produces valid clang-cl command in build.ninja.
system parameters
- Windows 11 64-bit
- Native build
- python 3.13.1
- meson 1.9.1
- miniaudio-0.11.22
- clang-cl 18.1.8
- ninja 1.12.1
Metadata
Metadata
Assignees
Labels
No labels