diff options
author | Brad King <brad.king@kitware.com> | 2018-02-21 15:02:52 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-02-21 15:13:47 (GMT) |
commit | 83f8e764676fca5f99fb66abfdc2fa3febea36e9 (patch) | |
tree | d54ce1cd057455eab1c4f5a838c8d9c24c0ca006 /Source/cmake.cxx | |
parent | 4e6f94d49ca591ff90ead5f00df71b22f97241e6 (diff) | |
download | CMake-83f8e764676fca5f99fb66abfdc2fa3febea36e9.zip CMake-83f8e764676fca5f99fb66abfdc2fa3febea36e9.tar.gz CMake-83f8e764676fca5f99fb66abfdc2fa3febea36e9.tar.bz2 |
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
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 5620723..f4f4a15 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -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; } |