mesonbuild/meson

Mingw64 cmake CMAKE_C_COMPILER illformatted string

Open

#14,636 创建于 2025年5月22日

在 GitHub 查看
 (1 评论) (1 反应) (0 负责人)Python (4,978 star) (1,465 fork)batch import
bughelp wantedmodule:cmakemsys

描述

Describe the bug An improper file path is provided to cmake subprojects when using mingw-w64-cmake.

To Reproduce Please include your meson.build files, preferably as a minimal toy example showing the issue. You may need to create simple source code files (don't include private/proprietary code).

  1. Install python,pip,meson &c through mingw when possible and pip when not.
  2. Install the mingw cmake package
  3. call meson configure with a cmake subproject in your root meson build: cmake = import('cmake') jansson_subproj = cmake.subproject('jansson-2.14.1') jansson_lib = jansson_subproj.dependency('jansson')

This should fail with the message: | The CMAKE_C_COMPILER: | C | is not a full path and was not found in the PATH. This is because meson generates a machine file for cmake (in my case it was at, \builddir\subprojects\jansson-2.14.1__CMake_build\CMakeMesonToolchainFile.cmake). The offending line was: set(CMAKE_C_COMPILER "C:/msys64/ucrt64/bin/cc.EXE") The mingw version of cmake uses the colon separator as a separator, as it is under unix. It looks like it catches the path separators to make them unix like, but does not escape the colon.

Expected behavior The colon to be escaped in the cmake var.

system parameters Native build. WIndows 10. Python 3.12.9 (from mingw) Meson 1.7.0 Ninja 1.12.1 cmake unknown because I have already uninstalled it. Possibly 3.31.5-1

贡献者指南