在具有多个 C 编译器的系统上,meson.get_compiler('c') 将选择什么编译器?

What compiler will be chosen by meson.get_compiler('c') on a system with multiple C compilers?

给定一个基于介子的项目,其中 meson.build 包含以下行:

cc = meson.get_compiler('c')

meson.get_compiler('c') 如何在具有多个 C 编译器的系统上选择编译器?在写这个问题的时候,参考手册没有提供太多细节,只有...

Returns a compiler object describing a compiler.

请注意,我并不是要强制 meson 使用特定的编译器。相反,我试图了解 meson.build 中的这一行, 当前编写的 ,将如何运作。

在 Windows 上,它会尝试 icl、cl、cc、gcc、clang、clang-cl、pgcc;在 Linux 上,它会尝试 cc、gcc、clang、nvc、pgc、icc。那是在它查找 $CC 的值以及交叉文件或本机文件中的任何内容之后。 See the code here.