diff options
author | Brad King <brad.king@kitware.com> | 2023-08-02 15:49:11 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-08-02 15:53:48 (GMT) |
commit | 0d1529000d3b52cc3468d90696f5b5b70616bb85 (patch) | |
tree | 5c4fd5a32ec5413042018c4bac11b92fcac55561 /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | 6e4822a035d1af77b9a86e36cdd213c3d2fce54c (diff) | |
download | CMake-0d1529000d3b52cc3468d90696f5b5b70616bb85.zip CMake-0d1529000d3b52cc3468d90696f5b5b70616bb85.tar.gz CMake-0d1529000d3b52cc3468d90696f5b5b70616bb85.tar.bz2 |
VS: Revert "Add CMake input files to ZERO_CHECK"
Since commit df58dbb0e9 (VS: Add CMake input files to ZERO_CHECK,
2023-03-19, v3.27.0-rc1~157^2), projects that specify the same file both
as input to `configure_file` and as the `MAIN_DEPENDENCY` of a custom
command fail to configure. Revert the change pending further
investigation. Add a test case demonstrating the problem.
Issue: #24557
Fixes: #25149
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 56 |
1 files changed, 1 insertions, 55 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 8d6b024..b3699ae 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -9,7 +9,6 @@ #include <set> #include <sstream> -#include <cm/filesystem> #include <cm/memory> #include <cm/optional> #include <cm/string_view> @@ -52,8 +51,6 @@ #include "cmValue.h" #include "cmVisualStudioGeneratorOptions.h" -const std::string kBuildSystemSources = "Buildsystem Input Files"; - struct cmIDEFlagTable; static void ConvertToWindowsSlash(std::string& s); @@ -1954,13 +1951,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups() "http://schemas.microsoft.com/developer/msbuild/2003"); for (auto const& ti : this->Tools) { - if ((this->GeneratorTarget->GetName() == - CMAKE_CHECK_BUILD_SYSTEM_TARGET) && - (ti.first == "None")) { - this->WriteBuildSystemSources(e0, ti.first, ti.second); - } else { - this->WriteGroupSources(e0, ti.first, ti.second, sourceGroups); - } + this->WriteGroupSources(e0, ti.first, ti.second, sourceGroups); } // Added files are images and the manifest. @@ -2031,18 +2022,6 @@ void cmVisualStudio10TargetGenerator::WriteGroups() "rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;" "gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms"); } - - if (this->GeneratorTarget->GetName() == - CMAKE_CHECK_BUILD_SYSTEM_TARGET) { - for (const std::string& filter : this->BuildSystemSourcesFilters) { - std::string guidName = "SG_Filter_"; - guidName += filter; - std::string guid = this->GlobalGenerator->GetGUID(guidName); - Elem e2(e1, "Filter"); - e2.Attribute("Include", filter); - e2.Element("UniqueIdentifier", "{" + guid + "}"); - } - } } } fout << '\n'; @@ -2109,39 +2088,6 @@ void cmVisualStudio10TargetGenerator::WriteGroupSources( } } -void cmVisualStudio10TargetGenerator::WriteBuildSystemSources( - Elem& e0, std::string const& name, ToolSources const& sources) -{ - const std::string srcDir = this->Makefile->GetCurrentSourceDirectory(); - const std::string::size_type srcDirLength = srcDir.length(); - - Elem e1(e0, "ItemGroup"); - e1.SetHasElements(); - for (ToolSource const& s : sources) { - cmSourceFile const* sf = s.SourceFile; - std::string const& source = sf->GetFullPath(); - - cm::filesystem::path sourcePath(source); - bool isInSrcDir = cmHasPrefix(source, srcDir); - - std::string filter = kBuildSystemSources; - if (isInSrcDir) { - std::string parentPath = sourcePath.parent_path().string(); - if (srcDir != parentPath) { - filter += parentPath.substr(srcDirLength); - } - ConvertToWindowsSlash(filter); - this->BuildSystemSourcesFilters.insert(filter); - } - - std::string path = this->ConvertPath(source, s.RelativePath); - ConvertToWindowsSlash(path); - Elem e2(e1, name); - e2.Attribute("Include", path); - e2.Element("Filter", filter); - } -} - void cmVisualStudio10TargetGenerator::WriteHeaderSource( Elem& e1, cmSourceFile const* sf, ConfigToSettings const& toolSettings) { |