Skip to content

Conversation

@dg0yt
Copy link
Contributor

@dg0yt dg0yt commented Nov 19, 2025

This is an untested rewrite of the line invoking mkversion on Windows, based on past vcpkg experience. (The current port version 4.4.2 doesn't invoke mkversion.)

The original "\"...\" ...." fails for some configurations.
It is a single CMake list item, with embedded quotes which go into a build system rule which may or may not get the inner quotes correctly for the actual invocation of the command.

The rule of thumb is:

  • Quote for CMake.
    There is only outer quotes for items in a cmake list.
  • Do not assume a particular shell for commands executed by the build system.
    There are different generators for different build systems.
    With ninja build files, commands may be executed via a shell or directly, depending on the system.
    With any type of inner quotes, portability will be limited.

The new line is a CMake list of command and items, with quoting for CMake when items can expand with special characters inside.
(Now this newest version contains an embedded CMake variable ${MKV_VERSION_OPT} which I didn't quote because I assume it is of list type, i.e. potentially expanding to multiple command line arguments.)

@MarkCallow
Copy link
Collaborator

What configurations does this fail on?

MKV_VERSION_OPT is a list. It is set at line 128.

@dg0yt
Copy link
Contributor Author

dg0yt commented Nov 21, 2025

This change was originally written for the Ninja generator, Windows, with MSYS2 bash in PATH - this is what is used in the vcpkg port.

The differences, https://ninja-build.org/manual.html#ref_rule_command:

On Unixes ... The Ninja command variable is passed directly to sh -c, which is then responsible for interpreting that string into an argv array.

On Windows ... Ninja passes the command string directly to CreateProcess.

I cannot quickly check the actual contents, or the output for VS generators. My MSVC environment is unprivileged access to vcpkg CI.

@MarkCallow MarkCallow merged commit 2aa509d into KhronosGroup:main Nov 24, 2025
49 checks passed
@dg0yt dg0yt deleted the patch-3 branch November 24, 2025 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants