diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/Checks/cm_cxx_features.cmake | 4 | ||||
-rw-r--r-- | Source/Checks/cm_cxx_filesystem.cxx | 11 | ||||
-rw-r--r-- | Source/cmCMakePresetsGraph.cxx | 5 | ||||
-rw-r--r-- | Source/cmCMakePresetsGraph.h | 2 | ||||
-rw-r--r-- | Source/cmCMakePresetsGraphReadJSON.cxx | 5 | ||||
-rw-r--r-- | Source/cmCMakePresetsGraphReadJSONTestPresets.cxx | 2 | ||||
-rw-r--r-- | Source/cmCTest.cxx | 18 | ||||
-rw-r--r-- | Source/cmCTest.h | 3 | ||||
-rw-r--r-- | Source/cmCoreTryCompile.cxx | 6 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/cmOutputConverter.cxx | 7 | ||||
-rw-r--r-- | Source/cmake.cxx | 5 |
14 files changed, 64 insertions, 11 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 867db77..2735e49 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 25) -set(CMake_VERSION_PATCH 20221018) +set(CMake_VERSION_PATCH 20221024) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake index c88f5a3..73e7ef2 100644 --- a/Source/Checks/cm_cxx_features.cmake +++ b/Source/Checks/cm_cxx_features.cmake @@ -80,9 +80,7 @@ if(CMake_HAVE_CXX_MAKE_UNIQUE) set(CMake_HAVE_CXX_UNIQUE_PTR 1) endif() cm_check_cxx_feature(unique_ptr) -if (NOT CMAKE_CXX_STANDARD LESS "17" - AND NOT MSYS # FIXME: RunCMake.cmake_path cases crash with MSYS std::filesystem - ) +if (NOT CMAKE_CXX_STANDARD LESS "17") if (NOT CMAKE_CROSSCOMPILING OR CMAKE_CROSSCOMPILING_EMULATOR) cm_check_cxx_feature(filesystem TRY_RUN) else() diff --git a/Source/Checks/cm_cxx_filesystem.cxx b/Source/Checks/cm_cxx_filesystem.cxx index ae8acc5..732f28f 100644 --- a/Source/Checks/cm_cxx_filesystem.cxx +++ b/Source/Checks/cm_cxx_filesystem.cxx @@ -23,5 +23,16 @@ int main() } #endif + // If std::string is copy-on-write, the std::filesystem::path + // implementation may accidentally trigger a reallocation and compute + // an offset between two allocations, leading to undefined behavior. +#if defined(__GLIBCXX__) && \ + (!defined(_GLIBCXX_USE_CXX11_ABI) || !_GLIBCXX_USE_CXX11_ABI) + std::string p5s1 = "/path"; + std::string p5s2 = std::move(p5s1); + std::filesystem::path p5 = std::string(p5s2); + p5.remove_filename(); +#endif + return 0; } diff --git a/Source/cmCMakePresetsGraph.cxx b/Source/cmCMakePresetsGraph.cxx index fb3d042..7325e44 100644 --- a/Source/cmCMakePresetsGraph.cxx +++ b/Source/cmCMakePresetsGraph.cxx @@ -265,6 +265,8 @@ bool ExpandMacros(const cmCMakePresetsGraph& graph, const TestPreset& preset, if (out->Output) { CHECK_EXPAND(out, out->Output->OutputLogFile, macroExpanders, graph.GetVersion(preset)); + CHECK_EXPAND(out, out->Output->OutputJUnitFile, macroExpanders, + graph.GetVersion(preset)); } if (out->Filter) { @@ -851,6 +853,7 @@ cmCMakePresetsGraph::TestPreset::VisitPresetInherit( parentOutput.OutputOnFailure); InheritOptionalValue(output.Quiet, parentOutput.Quiet); InheritString(output.OutputLogFile, parentOutput.OutputLogFile); + InheritString(output.OutputJUnitFile, parentOutput.OutputJUnitFile); InheritOptionalValue(output.LabelSummary, parentOutput.LabelSummary); InheritOptionalValue(output.SubprojectSummary, parentOutput.SubprojectSummary); @@ -1253,6 +1256,8 @@ const char* cmCMakePresetsGraph::ResultToString(ReadFileResult result) return "Invalid workflow steps"; case ReadFileResult::WORKFLOW_STEP_UNREACHABLE_FROM_FILE: return "Workflow step is unreachable from preset's file"; + case ReadFileResult::CTEST_JUNIT_UNSUPPORTED: + return "File version must be 6 or higher for CTest JUnit output support"; } return "Unknown error"; diff --git a/Source/cmCMakePresetsGraph.h b/Source/cmCMakePresetsGraph.h index 5b3e812..17c902b 100644 --- a/Source/cmCMakePresetsGraph.h +++ b/Source/cmCMakePresetsGraph.h @@ -54,6 +54,7 @@ public: TEST_OUTPUT_TRUNCATION_UNSUPPORTED, INVALID_WORKFLOW_STEPS, WORKFLOW_STEP_UNREACHABLE_FROM_FILE, + CTEST_JUNIT_UNSUPPORTED, }; std::string errors; @@ -230,6 +231,7 @@ public: cm::optional<bool> OutputOnFailure; cm::optional<bool> Quiet; std::string OutputLogFile; + std::string OutputJUnitFile; cm::optional<bool> LabelSummary; cm::optional<bool> SubprojectSummary; cm::optional<int> MaxPassedTestOutputSize; diff --git a/Source/cmCMakePresetsGraphReadJSON.cxx b/Source/cmCMakePresetsGraphReadJSON.cxx index 5aa4284..eec53c1 100644 --- a/Source/cmCMakePresetsGraphReadJSON.cxx +++ b/Source/cmCMakePresetsGraphReadJSON.cxx @@ -588,6 +588,11 @@ cmCMakePresetsGraph::ReadFileResult cmCMakePresetsGraph::ReadJSONFile( return ReadFileResult::TEST_OUTPUT_TRUNCATION_UNSUPPORTED; } + // Support for outputJUnitFile added in version 6. + if (v < 6 && preset.Output && !preset.Output->OutputJUnitFile.empty()) { + return ReadFileResult::CTEST_JUNIT_UNSUPPORTED; + } + this->TestPresetOrder.push_back(preset.Name); } diff --git a/Source/cmCMakePresetsGraphReadJSONTestPresets.cxx b/Source/cmCMakePresetsGraphReadJSONTestPresets.cxx index c07d380..3856f63 100644 --- a/Source/cmCMakePresetsGraphReadJSONTestPresets.cxx +++ b/Source/cmCMakePresetsGraphReadJSONTestPresets.cxx @@ -104,6 +104,8 @@ auto const TestPresetOptionalOutputHelper = cmCMakePresetsGraphInternal::PresetOptionalBoolHelper, false) .Bind("outputLogFile"_s, &TestPreset::OutputOptions::OutputLogFile, cmCMakePresetsGraphInternal::PresetStringHelper, false) + .Bind("outputJUnitFile"_s, &TestPreset::OutputOptions::OutputJUnitFile, + cmCMakePresetsGraphInternal::PresetStringHelper, false) .Bind("labelSummary"_s, &TestPreset::OutputOptions::LabelSummary, cmCMakePresetsGraphInternal::PresetOptionalBoolHelper, false) .Bind("subprojectSummary"_s, diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 66507a7..f60a1e9 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2116,11 +2116,7 @@ bool cmCTest::HandleCommandLineArguments(size_t& i, return false; } i++; - this->Impl->TestHandler.SetJUnitXMLFileName(std::string(args[i])); - // Turn test output compression off. - // This makes it easier to include test output in the resulting - // JUnit XML report. - this->Impl->CompressTestOutput = false; + this->SetOutputJUnitFileName(std::string(args[i])); } cm::string_view noTestsPrefix = "--no-tests="; @@ -2458,6 +2454,9 @@ bool cmCTest::SetArgsFromPreset(const std::string& presetName, if (!expandedPreset->Output->OutputLogFile.empty()) { this->SetOutputLogFileName(expandedPreset->Output->OutputLogFile); } + if (!expandedPreset->Output->OutputJUnitFile.empty()) { + this->SetOutputJUnitFileName(expandedPreset->Output->OutputJUnitFile); + } this->Impl->LabelSummary = expandedPreset->Output->LabelSummary.value_or(true); @@ -3541,6 +3540,15 @@ void cmCTest::SetOutputLogFileName(const std::string& name) } } +void cmCTest::SetOutputJUnitFileName(const std::string& name) +{ + this->Impl->TestHandler.SetJUnitXMLFileName(name); + // Turn test output compression off. + // This makes it easier to include test output in the resulting + // JUnit XML report. + this->Impl->CompressTestOutput = false; +} + static const char* cmCTestStringLogType[] = { "DEBUG", "OUTPUT", "HANDLER_OUTPUT", diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 551c116..0017b3e 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -359,6 +359,9 @@ public: /** Set the output log file name */ void SetOutputLogFileName(const std::string& name); + /** Set the output JUnit file name */ + void SetOutputJUnitFileName(const std::string& name); + /** Set the visual studio or Xcode config type */ void SetConfigType(const std::string& ct); diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 588f44a..867f984 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -630,6 +630,12 @@ bool cmCoreTryCompile::TryCompileCode(Arguments& arguments, fprintf(fout, "cmake_policy(SET CMP0126 OLD)\n"); } + /* Set language extensions policy to match outer project. */ + if (this->Makefile->GetPolicyStatus(cmPolicies::CMP0128) != + cmPolicies::NEW) { + fprintf(fout, "cmake_policy(SET CMP0128 OLD)\n"); + } + std::string projectLangs; for (std::string const& li : testLangs) { projectLangs += " " + li; diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 6195d1f..321122a 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -5532,7 +5532,7 @@ cmGeneratorTarget::GetTargetSourceFileFlags(const cmSourceFile* sf) const } else if (cmHasLiteralPrefix(*location, "Resources/")) { flags.Type = cmGeneratorTarget::SourceFileTypeDeepResource; if (stripResources) { - flags.MacFolder += strlen("Resources/"); + flags.MacFolder += cmStrLen("Resources/"); } } else { flags.Type = cmGeneratorTarget::SourceFileTypeMacContent; diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index deed3f8..9d168d0 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -620,7 +620,8 @@ bool IsVisualStudioMacrosFileRegistered(const std::string& macrosFile, RegCloseKey(hsubkey); } else { - std::cout << "error opening subkey: " << subkeyname << std::endl; + std::cout << "error opening subkey: " + << cmsys::Encoding::ToNarrow(subkeyname) << std::endl; std::cout << std::endl; } diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx index 6883535..299ab3a 100644 --- a/Source/cmOutputConverter.cxx +++ b/Source/cmOutputConverter.cxx @@ -527,6 +527,13 @@ bool cmOutputConverter::Shell_ArgumentNeedsQuotes(cm::string_view in, } } + /* UNC paths in MinGW Makefiles need quotes. */ + if ((flags & Shell_Flag_MinGWMake) && (flags & Shell_Flag_Make)) { + if (in.size() > 1 && in[0] == '\\' && in[1] == '\\') { + return true; + } + } + return false; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 8cdecc6..73b8e88 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -787,6 +787,7 @@ enum class ListPresets Build, Test, Package, + Workflow, All, }; } @@ -1144,6 +1145,8 @@ void cmake::SetArgs(const std::vector<std::string>& args) listPresets = ListPresets::Test; } else if (value == "package") { listPresets = ListPresets::Package; + } else if (value == "workflow") { + listPresets = ListPresets::Workflow; } else if (value == "all") { listPresets = ListPresets::All; } else { @@ -1313,6 +1316,8 @@ void cmake::SetArgs(const std::vector<std::string>& args) presetsGraph.PrintTestPresetList(); } else if (listPresets == ListPresets::Package) { presetsGraph.PrintPackagePresetList(); + } else if (listPresets == ListPresets::Workflow) { + presetsGraph.PrintWorkflowPresetList(); } else if (listPresets == ListPresets::All) { presetsGraph.PrintAllPresets(); } |