mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.63k stars 1.64k forks source link

Linking against llvm on windows fails when path to llvm contains spaces #13706

Open apache-hb opened 1 month ago

apache-hb commented 1 month ago

Describe the bug Linking against llvm via dependency('llvm') produces invalid ninja build rules

To Reproduce

project('example', 'cpp')
llvm = dependency('llvm', components: ['core'], method: 'config-tool', static: true)
executable('hello', dependencies: llvm)

Expected behavior llvm is linked correctly

system parameters

apache-hb commented 1 month ago

Narrowed this down to split_args in universal.py not liking the output of llvm-config --libs --ldflags --link-static --system-libs.

How does llvm expect a program to reliably parse this...

-LIBPATH:C:\Program Files\LLVM\lib C:\Program Files\LLVM\lib\LLVMWindowsManifest.lib C:\Program Files\LLVM\lib\LLVMXRay.lib C:\Program Files\LLVM\lib\LLVMLibDriver.lib C:\Program Files\LLVM\lib\LLVMDlltoolDriver.lib C:\Program Files\LLVM\lib\LLVMTextAPIBinaryReader.lib