mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
cmake --build: Improve errors when no preset is specified
Add a better error message and tests to verify.
This commit is contained in:
@@ -523,7 +523,8 @@ int do_build(int ac, char const* const* av)
|
||||
cmCommandLineArgument<bool(std::string const& value)>;
|
||||
|
||||
std::vector<CommandArgument> arguments = {
|
||||
CommandArgument{ "--preset", CommandArgument::Values::One,
|
||||
CommandArgument{ "--preset", "No preset specified for --preset",
|
||||
CommandArgument::Values::One,
|
||||
CommandArgument::setToValue(presetName) },
|
||||
CommandArgument{ "--list-presets", CommandArgument::Values::Zero,
|
||||
CommandArgument::setToTrue(listPresets) },
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1 @@
|
||||
^CMake Error: No preset specified for --preset
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1 @@
|
||||
^CMake Error: No preset specified for --preset
|
||||
@@ -75,6 +75,8 @@ run_cmake_build_presets(InvalidConfigurePreset "default" "badConfigurePreset" ""
|
||||
run_cmake_build_presets(Condition "default" "enabled;disabled" "")
|
||||
|
||||
set(CMakePresetsBuild_BUILD_ONLY 1)
|
||||
run_cmake_command(PresetsNoArg-build ${CMAKE_COMMAND} "--build" "--preset")
|
||||
run_cmake_command(PresetsNoArgEq-build ${CMAKE_COMMAND} "--build" "--preset=")
|
||||
run_cmake_build_presets(ListPresets "x" "x" "--list-presets" "")
|
||||
run_cmake_build_presets(NoConfigurePreset "x" "noConfigurePreset" "")
|
||||
run_cmake_build_presets(Invalid "x" "hidden;vendorMacro" "")
|
||||
|
||||
Reference in New Issue
Block a user