mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 13:20:47 -06:00
cmake_transform_depfile: Remove unused incomplete vstlog support
In commit b2c14bc774 (cmake -E: Add cmake_transform_depfile internal
command, 2020-10-02, v3.20.0-rc1~684^2~2) a partial implementation for
converting MSBuild "TLog" format files was added. However, it is
unused and incomplete:
* Does not enforce absolute paths as TLog docs require.
* Does not upper-case paths as TLog docs recommend.
* The TLog format semantics are not equivalent to `out: in`.
Remove the unused TLog transform infrastructure to avoid confusion.
Issue: #20286
This commit is contained in:
@@ -227,9 +227,6 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(
|
|||||||
case cmDepfileFormat::GccDepfile:
|
case cmDepfileFormat::GccDepfile:
|
||||||
argv.emplace_back("gccdepfile");
|
argv.emplace_back("gccdepfile");
|
||||||
break;
|
break;
|
||||||
case cmDepfileFormat::VsTlog:
|
|
||||||
argv.emplace_back("vstlog");
|
|
||||||
break;
|
|
||||||
case cmDepfileFormat::MakeDepfile:
|
case cmDepfileFormat::MakeDepfile:
|
||||||
argv.emplace_back("makedepfile");
|
argv.emplace_back("makedepfile");
|
||||||
break;
|
break;
|
||||||
@@ -440,9 +437,6 @@ std::string cmCustomCommandGenerator::GetInternalDepfileName(
|
|||||||
case cmDepfileFormat::MakeDepfile:
|
case cmDepfileFormat::MakeDepfile:
|
||||||
extension = ".d";
|
extension = ".d";
|
||||||
break;
|
break;
|
||||||
case cmDepfileFormat::VsTlog:
|
|
||||||
extension = ".tlog";
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return cmStrCat(this->LG->GetBinaryDirectory(), "/CMakeFiles/d/",
|
return cmStrCat(this->LG->GetBinaryDirectory(), "/CMakeFiles/d/",
|
||||||
hash.HashString(depfile), extension);
|
hash.HashString(depfile), extension);
|
||||||
|
|||||||
@@ -78,37 +78,6 @@ void WriteDepfile(cmDepfileFormat format, cmsys::ofstream& fout,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// tlog format : always windows paths on Windows regardless the generator
|
|
||||||
std::string ConvertToTLogOutputPath(const std::string& path)
|
|
||||||
{
|
|
||||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
|
||||||
return cmSystemTools::ConvertToWindowsOutputPath(path);
|
|
||||||
#else
|
|
||||||
return cmSystemTools::ConvertToOutputPath(path);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void WriteVsTlog(cmsys::ofstream& fout, const cmLocalGenerator& lg,
|
|
||||||
const cmGccDepfileContent& content)
|
|
||||||
{
|
|
||||||
for (auto const& dep : content) {
|
|
||||||
fout << '^';
|
|
||||||
bool first = true;
|
|
||||||
for (auto const& rule : dep.rules) {
|
|
||||||
if (!first) {
|
|
||||||
fout << '|';
|
|
||||||
}
|
|
||||||
first = false;
|
|
||||||
fout << ConvertToTLogOutputPath(lg.MaybeRelativeToTopBinDir(rule));
|
|
||||||
}
|
|
||||||
fout << "\r\n";
|
|
||||||
for (auto const& path : dep.paths) {
|
|
||||||
fout << ConvertToTLogOutputPath(lg.MaybeRelativeToTopBinDir(path))
|
|
||||||
<< "\r\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmTransformDepfile(cmDepfileFormat format, const cmLocalGenerator& lg,
|
bool cmTransformDepfile(cmDepfileFormat format, const cmLocalGenerator& lg,
|
||||||
@@ -133,9 +102,6 @@ bool cmTransformDepfile(cmDepfileFormat format, const cmLocalGenerator& lg,
|
|||||||
case cmDepfileFormat::MakeDepfile:
|
case cmDepfileFormat::MakeDepfile:
|
||||||
WriteDepfile(format, fout, lg, content);
|
WriteDepfile(format, fout, lg, content);
|
||||||
break;
|
break;
|
||||||
case cmDepfileFormat::VsTlog:
|
|
||||||
WriteVsTlog(fout, lg, content);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
enum class cmDepfileFormat
|
enum class cmDepfileFormat
|
||||||
{
|
{
|
||||||
GccDepfile,
|
GccDepfile,
|
||||||
VsTlog,
|
|
||||||
MakeDepfile
|
MakeDepfile
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1529,8 +1529,6 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args,
|
|||||||
auto format = cmDepfileFormat::GccDepfile;
|
auto format = cmDepfileFormat::GccDepfile;
|
||||||
if (args[3] == "gccdepfile") {
|
if (args[3] == "gccdepfile") {
|
||||||
format = cmDepfileFormat::GccDepfile;
|
format = cmDepfileFormat::GccDepfile;
|
||||||
} else if (args[3] == "vstlog") {
|
|
||||||
format = cmDepfileFormat::VsTlog;
|
|
||||||
} else if (args[3] == "makedepfile") {
|
} else if (args[3] == "makedepfile") {
|
||||||
format = cmDepfileFormat::MakeDepfile;
|
format = cmDepfileFormat::MakeDepfile;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -5,10 +5,6 @@ function(run_transform_depfile name)
|
|||||||
run_cmake_command(${name}-gcc
|
run_cmake_command(${name}-gcc
|
||||||
${CMAKE_COMMAND} -E cmake_transform_depfile "${RunCMake_GENERATOR}" gccdepfile "${RunCMake_SOURCE_DIR}" "${RunCMake_SOURCE_DIR}/subdir" "${RunCMake_BINARY_DIR}" "${RunCMake_BINARY_DIR}/subdir" "${CMAKE_CURRENT_LIST_DIR}/${name}.d" out.d
|
${CMAKE_COMMAND} -E cmake_transform_depfile "${RunCMake_GENERATOR}" gccdepfile "${RunCMake_SOURCE_DIR}" "${RunCMake_SOURCE_DIR}/subdir" "${RunCMake_BINARY_DIR}" "${RunCMake_BINARY_DIR}/subdir" "${CMAKE_CURRENT_LIST_DIR}/${name}.d" out.d
|
||||||
)
|
)
|
||||||
set(RunCMake-check-file vstlog.cmake)
|
|
||||||
run_cmake_command(${name}-tlog
|
|
||||||
${CMAKE_COMMAND} -E cmake_transform_depfile "${RunCMake_GENERATOR}" vstlog "${RunCMake_SOURCE_DIR}" "${RunCMake_SOURCE_DIR}/subdir" "${RunCMake_BINARY_DIR}" "${RunCMake_BINARY_DIR}/subdir" "${CMAKE_CURRENT_LIST_DIR}/${name}.d" out.tlog
|
|
||||||
)
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
|||||||
Reference in New Issue
Block a user