mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 00:11:07 -06:00
Ninja Multi-Config: Restore rebuild_cache and edit_cache targets
Since commit dcf9f4d2f7 (Ninja Multi-Config: Add support for
cross-config custom commands, 2020-12-09) we were not generating these
targets. Restore them and add a test.
Fixes: #21722
This commit is contained in:
@@ -35,6 +35,11 @@ cmNinjaUtilityTargetGenerator::~cmNinjaUtilityTargetGenerator() = default;
|
||||
|
||||
void cmNinjaUtilityTargetGenerator::Generate(const std::string& config)
|
||||
{
|
||||
if (!this->GetGeneratorTarget()->Target->IsPerConfig()) {
|
||||
this->WriteUtilBuildStatements(config, config);
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto const& fileConfig : this->GetConfigNames()) {
|
||||
if (!this->GetGlobalGenerator()
|
||||
->GetCrossConfigs(fileConfig)
|
||||
|
||||
@@ -85,6 +85,9 @@ set(RunCMake_TEST_OPTIONS "-DCMAKE_CONFIGURATION_TYPES=RelWithDebInfo\\;Debug\\;
|
||||
run_cmake_configure(Simple)
|
||||
unset(RunCMake_TEST_OPTIONS)
|
||||
include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake)
|
||||
run_ninja(Simple targets-default build.ninja -t targets)
|
||||
run_ninja(Simple targets-debug build-Debug.ninja -t targets)
|
||||
run_ninja(Simple targets-release build-Debug.ninja -t targets)
|
||||
run_cmake_build(Simple debug-target Debug simpleexe)
|
||||
run_ninja(Simple debug-target build-Debug.ninja simplestatic)
|
||||
get_filename_component(simpleshared_Release "${TARGET_FILE_simpleshared_Release}" NAME)
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
(rebuild_cache: phony.*
|
||||
edit_cache: phony|edit_cache: phony.*
|
||||
rebuild_cache: phony)
|
||||
@@ -0,0 +1,3 @@
|
||||
(rebuild_cache: phony.*
|
||||
edit_cache: phony|edit_cache: phony.*
|
||||
rebuild_cache: phony)
|
||||
@@ -0,0 +1,3 @@
|
||||
(rebuild_cache: phony.*
|
||||
edit_cache: phony|edit_cache: phony.*
|
||||
rebuild_cache: phony)
|
||||
Reference in New Issue
Block a user