mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-06 04:03:27 +03:00
cmake: Fix global generator path style in --build mode
Fix the `--build` code path so that `cmSystemTools::SetForceUnixPaths` is called with the global generator's path style. This makes forwarding of `--target subdir/src.c.obj` match the slash style the generator placed in the build system. Fixes: #17742
This commit is contained in:
1 parent
4e6f94d49c
commit
83f8e76467
1 file changed
+4
-4
+4
-4
@@ -2387,17 +2387,17 @@ int cmake::Build(const std::string& dir, const std::string& target,
|
||||
std::cerr << "Error: could not find CMAKE_GENERATOR in Cache\n";
|
||||
return 1;
|
||||
}
|
||||
std::unique_ptr<cmGlobalGenerator> gen(
|
||||
this->CreateGlobalGenerator(cachedGenerator));
|
||||
if (!gen.get()) {
|
||||
cmGlobalGenerator* gen = this->CreateGlobalGenerator(cachedGenerator);
|
||||
if (!gen) {
|
||||
std::cerr << "Error: could create CMAKE_GENERATOR \"" << cachedGenerator
|
||||
<< "\"\n";
|
||||
return 1;
|
||||
}
|
||||
this->SetGlobalGenerator(gen);
|
||||
const char* cachedGeneratorInstance =
|
||||
this->State->GetCacheEntryValue("CMAKE_GENERATOR_INSTANCE");
|
||||
if (cachedGeneratorInstance) {
|
||||
cmMakefile mf(gen.get(), this->GetCurrentSnapshot());
|
||||
cmMakefile mf(gen, this->GetCurrentSnapshot());
|
||||
if (!gen->SetGeneratorInstance(cachedGeneratorInstance, &mf)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user