summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/cpack.cxx4
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx13
-rw-r--r--Source/cmGlobalNinjaGenerator.h1
-rw-r--r--Source/cmVSSetupHelper.cxx23
4 files changed, 23 insertions, 18 deletions
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 631bfd9..f06946b 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -173,8 +173,8 @@ int main(int argc, char const* const* argv)
CommandArgument{ "--debug", CommandArgument::Values::Zero, debugLambda },
CommandArgument{ "--config", CommandArgument::Values::One,
CommandArgument::setToValue(cpackConfigFile) },
- CommandArgument{ "--trace", CommandArgument::Values::One, traceLambda },
- CommandArgument{ "--trace-expand", CommandArgument::Values::One,
+ CommandArgument{ "--trace", CommandArgument::Values::Zero, traceLambda },
+ CommandArgument{ "--trace-expand", CommandArgument::Values::Zero,
traceExpandLambda },
CommandArgument{ "-C", CommandArgument::Values::One,
CommandArgument::setToValue(cpackBuildConfig) },
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index c326ca6..077de42 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -1030,19 +1030,6 @@ bool cmGlobalNinjaGenerator::OpenBuildFileStreams()
return false;
}
- // New buffer size 8 MiB
- constexpr auto buildFileStreamBufferSize = 8 * 1024 * 1024;
-
- // Ensure the buffer is allocated
- if (!this->BuildFileStreamBuffer) {
- this->BuildFileStreamBuffer =
- cm::make_unique<char[]>(buildFileStreamBufferSize);
- }
-
- // Enlarge the internal buffer of the `BuildFileStream`
- this->BuildFileStream->rdbuf()->pubsetbuf(this->BuildFileStreamBuffer.get(),
- buildFileStreamBufferSize);
-
// Write a comment about this file.
*this->BuildFileStream
<< "# This file contains all the build statements describing the\n"
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index dc4f444..defa264 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -531,7 +531,6 @@ private:
/// The file containing the build statement. (the relationship of the
/// compilation DAG).
std::unique_ptr<cmGeneratedFileStream> BuildFileStream;
- std::unique_ptr<char[]> BuildFileStreamBuffer;
/// The file containing the rule statements. (The action attached to each
/// edge of the compilation DAG).
std::unique_ptr<cmGeneratedFileStream> RulesFileStream;
diff --git a/Source/cmVSSetupHelper.cxx b/Source/cmVSSetupHelper.cxx
index 1a3e72e..8764f21 100644
--- a/Source/cmVSSetupHelper.cxx
+++ b/Source/cmVSSetupHelper.cxx
@@ -300,13 +300,32 @@ bool cmVSSetupAPIHelper::IsEWDKEnabled()
return false;
}
+#if !defined(CMAKE_BOOTSTRAP)
+namespace {
+std::string FindVsWhereCommand()
+{
+ std::string vswhere;
+ static const char* programFiles[] = { "ProgramFiles(x86)", "ProgramFiles" };
+ for (const char* pf : programFiles) {
+ if (cmSystemTools::GetEnv(pf, vswhere)) {
+ vswhere += "/Microsoft Visual Studio/Installer/vswhere.exe";
+ if (cmSystemTools::FileExists(vswhere)) {
+ return vswhere;
+ }
+ }
+ }
+ vswhere = "vswhere.exe";
+ return vswhere;
+}
+}
+#endif
+
bool cmVSSetupAPIHelper::EnumerateVSInstancesWithVswhere(
std::vector<VSInstanceInfo>& VSInstances)
{
#if !defined(CMAKE_BOOTSTRAP)
// Construct vswhere command to get installed VS instances in JSON format
- std::string vswhereExe = getenv("ProgramFiles(x86)") +
- std::string(R"(\Microsoft Visual Studio\Installer\vswhere.exe)");
+ std::string vswhereExe = FindVsWhereCommand();
std::vector<std::string> vswhereCmd = { vswhereExe, "-format", "json" };
// Execute vswhere command and capture JSON output