mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 02:08:27 +08:00
Makefiles: Remove non-functioning relative path conversion
In CMake 3.6 and below, running
cmake --build . --target "$(pwd)/SomeTarget"
with a Makefiles generator automatically converted the target
name and invoked `make SomeTarget`. This made the build command
work even though
make "$(pwd)/SomeTarget"
would fail. This behavior was not implemented for any other generators,
and does not make sense because `cmake --build` is supposed to be a thin
wrapper around the native build tool. It has also been broken since
commit 8d47a20f13
(cmOutputConverter: use new ConvertToRelativePath
signature internally, 2016-06-16, v3.7.0-rc1~90^2~1) because cmState's
relative path conversion logic is not initialized in `cmake --build`.
Remove the non-functioning code.
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
#include "cmOutputConverter.h"
|
||||
#include "cmProperty.h"
|
||||
#include "cmState.h"
|
||||
#include "cmStateDirectory.h"
|
||||
#include "cmStateTypes.h"
|
||||
#include "cmStringAlgorithms.h"
|
||||
#include "cmSystemTools.h"
|
||||
@@ -552,21 +551,6 @@ cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
|
||||
bool fast, int jobs, bool verbose,
|
||||
std::vector<std::string> const& makeOptions)
|
||||
{
|
||||
std::unique_ptr<cmMakefile> mfu;
|
||||
cmMakefile* mf;
|
||||
if (!this->Makefiles.empty()) {
|
||||
mf = this->Makefiles[0].get();
|
||||
} else {
|
||||
cmStateSnapshot snapshot = this->CMakeInstance->GetCurrentSnapshot();
|
||||
snapshot.GetDirectory().SetCurrentSource(
|
||||
this->CMakeInstance->GetHomeDirectory());
|
||||
snapshot.GetDirectory().SetCurrentBinary(
|
||||
this->CMakeInstance->GetHomeOutputDirectory());
|
||||
snapshot.SetDefaultDefinitions();
|
||||
mfu = cm::make_unique<cmMakefile>(this, snapshot);
|
||||
mf = mfu.get();
|
||||
}
|
||||
|
||||
GeneratedMakeCommand makeCommand;
|
||||
|
||||
// Make it possible to set verbosity also from command line
|
||||
@@ -597,9 +581,6 @@ cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
|
||||
if (fast) {
|
||||
tname += "/fast";
|
||||
}
|
||||
tname =
|
||||
mf->GetStateSnapshot().GetDirectory().ConvertToRelPathIfContained(
|
||||
mf->GetState()->GetBinaryDirectory(), tname);
|
||||
cmSystemTools::ConvertToOutputSlashes(tname);
|
||||
makeCommand.Add(std::move(tname));
|
||||
}
|
||||
|
Reference in New Issue
Block a user