summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudioGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-09-26 13:49:36 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-09-26 13:49:56 (GMT)
commita29b8d285e176b40c9c5f1ce506dd97ed38f9c97 (patch)
tree312d94b9dc3514c0214ca3b57bddb91111d35b88 /Source/cmGlobalVisualStudioGenerator.cxx
parentdf982c4e189c01896db487ec5edfe85d27911007 (diff)
parent7847fef51056432e2e822b64d72b598a993e9524 (diff)
downloadCMake-a29b8d285e176b40c9c5f1ce506dd97ed38f9c97.zip
CMake-a29b8d285e176b40c9c5f1ce506dd97ed38f9c97.tar.gz
CMake-a29b8d285e176b40c9c5f1ce506dd97ed38f9c97.tar.bz2
Merge topic 'fix-vsmacro-access-violation'
7847fef510 VS: Fix access violation when calling Visual Studio macro Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3853
Diffstat (limited to 'Source/cmGlobalVisualStudioGenerator.cxx')
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx16
1 files changed, 3 insertions, 13 deletions
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 108a44f..7a564ed 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -288,11 +288,10 @@ void cmGlobalVisualStudioGenerator::ConfigureCMakeVisualStudioMacros()
}
void cmGlobalVisualStudioGenerator::CallVisualStudioMacro(
- MacroName m, const char* vsSolutionFile)
+ MacroName m, const std::string& vsSolutionFile)
{
// If any solution or project files changed during the generation,
// tell Visual Studio to reload them...
- cmMakefile* mf = this->LocalGenerators[0]->GetMakefile();
std::string dir = this->GetUserMacrosDirectory();
// Only really try to call the macro if:
@@ -307,27 +306,18 @@ void cmGlobalVisualStudioGenerator::CallVisualStudioMacro(
if (cmSystemTools::FileExists(macrosFile.c_str()) &&
IsVisualStudioMacrosFileRegistered(
macrosFile, this->GetUserMacrosRegKeyBase(), nextSubkeyName)) {
- std::string topLevelSlnName;
- if (vsSolutionFile) {
- topLevelSlnName = vsSolutionFile;
- } else {
- topLevelSlnName =
- cmStrCat(mf->GetCurrentBinaryDirectory(), '/',
- this->LocalGenerators[0]->GetProjectName(), ".sln");
- }
-
if (m == MacroReload) {
std::vector<std::string> filenames;
this->GetFilesReplacedDuringGenerate(filenames);
if (!filenames.empty()) {
std::string projects = cmJoin(filenames, ";");
cmCallVisualStudioMacro::CallMacro(
- topLevelSlnName, CMAKE_VSMACROS_RELOAD_MACRONAME, projects,
+ vsSolutionFile, CMAKE_VSMACROS_RELOAD_MACRONAME, projects,
this->GetCMakeInstance()->GetDebugOutput());
}
} else if (m == MacroStop) {
cmCallVisualStudioMacro::CallMacro(
- topLevelSlnName, CMAKE_VSMACROS_STOP_MACRONAME, "",
+ vsSolutionFile, CMAKE_VSMACROS_STOP_MACRONAME, "",
this->GetCMakeInstance()->GetDebugOutput());
}
}