Add cmake tool functions

This commit is contained in:
crazywhalecc
2025-06-09 00:34:25 +08:00
parent 521af84797
commit 7d26aa533a
2 changed files with 16 additions and 5 deletions

View File

@@ -210,3 +210,9 @@ function get_cmake_version(): ?string
}
return null;
}
function cmake_boolean_args(string $arg_name, bool $negative = false): array
{
$res = ["-D{$arg_name}=ON", "-D{$arg_name}=OFF"];
return $negative ? array_reverse($res) : $res;
}