muon-build / muon

An implementation of the meson build system in c99
https://muon.build
GNU General Public License v3.0
166 stars 14 forks source link

muon doesn't support llvm-mingw? #48

Closed Curculigo closed 3 months ago

Curculigo commented 3 months ago

Bootstrap is fine. But muon setup failed.

C:\Work\muon>muon setup build
file C:/Work/llvm-mingw-20240619-ucrt-x86_64/bin/ld is not a MS-DOS file
err failed to detect linker
C:/Work/muon/meson.build:7:5: error unable to detect c compiler
  7 |     'c',
          ^__
C:/Work/muon/meson.build:5:1: error in function project
  5 | / project(
  6 | |     'muon',
  7 | |     'c',
  8 | |     version: '0.2.0',
  9 | |     license: 'GPL-3.0-only',
 10 | |     meson_version: '>=0.59.0',
 11 | |     default_options: [
 12 | |         'warning_level=3',
 13 | |         'buildtype=debug',
 14 | |         'default_library=static',
 15 | |     ],
 16 | | )
      |__^
vtorri commented 3 months ago

where did you get the compiler and linker please ?

Curculigo commented 3 months ago

where did you get the compiler and linker please ?

I think llvm-mingw is a fairly well known project that Google search will bring you immediately to the repository?

https://github.com/mstorsjo/llvm-mingw

vtorri commented 3 months ago

ok, so set the compiler and linker with env.CC and env.LD like that muon setup -Denv.CC= -Denv.LD= builddir

you can do the same with CC and LD environment variables

I use the same toolchains with MSYS2, easy to install. And they are supported, as I've tested them.

your problem is that muon is selecting by default some compilers/linkers. In you case, muon uses ld by default, which is a UNIX linker, not a Windows one.

Curculigo commented 3 months ago

muon setup -Denv.CC=clang -Denv.LD=ld.lld build worked. Thank you.