Siril 1.5 ビルドエラー / Invalid character escape ‘\m’.

Siril 1.5 をソースからビルドするとエラー表示

| -- Could NOT find NSIS (missing: NSIS_MAKE)
| -- Found PkgConfig: C:/msys64/ucrt64/bin/pkg-config.exe (found version "3.0.5")
| CMake Warning (policy) at CMakeLists.txt:74 (add_custom_target):
| Policy CMP0219 is not set: Macro invocations preserve backslashes in
| arguments.  Run "cmake --help-policy CMP0219" for policy details.  Use the
| cmake_policy command to set the policy and suppress this warning.

| Command "add_custom_target" called with arguments containing backslashes.

| Since the policy is not set, backslashes in the arguments:

| "C:\msys64\ucrt64\bin/ninja.exe"

| will be interpreted as escape sequences for compatibility.

| Set the policy to NEW to instead pass

| "C:\\msys64\\ucrt64\\bin/ninja.exe"

| so that argument parsing will preserve the original values.
| This warning is for project developers.  Use -Wno-author or -Wno-policy to
| suppress it.

| CMake Error at C:/msys64/ucrt64/lib/python3.14/site-packages/mesonbuild/cmake/data/preload.cmake:39 (_add_custom_target):
| Syntax error in cmake code when parsing string

| dist;COMMAND;C:\msys64\ucrt64\bin/ninja.exe;package_source

| Invalid character escape '\m'.
| Call Stack (most recent call first):
| CMakeLists.txt:74 (add_custom_target)


| CMake Error at C:/msys64/ucrt64/lib/python3.14/site-packages/mesonbuild/cmake/data/preload.cmake:39 (_add_custom_target):
| Syntax error in cmake code at

| C:/msys64/ucrt64/lib/python3.14/site-packages/mesonbuild/cmake/data/preload.cmake:39

| when parsing string

| dist;COMMAND;C:\msys64\ucrt64\bin/ninja.exe;package_source

| Invalid character escape '\m'.
| Call Stack (most recent call first):
| CMakeLists.txt:74 (add_custom_target)


| -- Configuring incomplete, errors occurred!

librtprocess| CMake configuration: FAILED

meson.build:343:19: ERROR: Failed to configure the CMake subproject

二回、表示されてる、文字エスケープが以下です。

Invalid character escape '\m'.

Windowsのファイルパスである C:\msys64… の \m という部分(バックスラッシュ+m)を、mesonプログラムが「改行(\n)やタブ(\t)のような特殊な文字コード(エスケープシーケンス)」だと勘違いし、「そんな特殊文字(\m)は存在しない」とエラーを起こしているらしい。

どこで \m が発生したかというと、

| dist;COMMAND;C:\msys64\ucrt64\bin/ninja.exe;package_source

ビルドツールである ninja.exe の場所を指定する際、Windows形式のパス(C:\msys64…)がそのまま入ってしまっている模様です。

どの箇所でエラーが起きているのかな?

librtprocess| CMake configuration: FAILED

meson.build:343:19: ERROR: Failed to configure the CMake subproject

librtprocess を CMakeを使って組み立てる時に、バックスラッシュを特殊文字と勘違いした様です。

Mesonツールが、CMakeツールにバックスラッシュ(\)を含んだWindowsのパスをそのまま渡したので、CMake側がそれを特殊文字(エスケープシーケンス)と勘違いして「そんな特殊文字は知らん!」と止まったようです。

\n → 改行
\t → タブ
\m「そんな特殊文字は知らない!」

C:\msys64 この箇所の、『”/m”が解らないよ』とCMakeが言ってます。

dist;COMMAND;C:\msys64\ucrt64\bin/ninja.exe;package_source
| "C:\msys64\ucrt64\bin/ninja.exe"

警告箇所があります。

 Set the policy to NEW to instead pass

| "C:\\msys64\\ucrt64\\bin/ninja.exe"

| so that argument parsing will preserve the original values.
| This warning is for project developers.  Use -Wno-author or -Wno-policy to
| suppress it.

「古いルール(OLD)のまま処理しちゃうから、パスが壊れて \m になっちゃうよ!新しいルール(NEW)に変えたほうがいいよ!」と警告した直後に、パスが壊れてエラーになり、ビルドが停止した様です。

バックスラッシュではなくて、スラッシュを使えば良いので、GUN/Linux風にコマンドを打ちます。
GUN/Linux風に、スラッシュを用いてninja コマンドを環境変数としてmesonに渡します。

meson setup _build --buildtype release -Dgtk=true ではなくて、
NINJA=/ucrt64/bin/ninja.exe meson setup _build --buildtype release -Dgtk=true

これでビルドが出来ます。

コメント