From a483fb58eeb2126b1c4ce666da2e51df08ebb7c6 Mon Sep 17 00:00:00 2001 From: ed Date: Sat, 17 Apr 2021 17:52:47 +0100 Subject: [PATCH] Projucer: Set pdb filename to match pdb output file to workaround broken VS2019 copy step When building a static library, VS2019 replaces the generated link pdb file with the one created during compilation due to a broken copy step in Microsoft.CppCommon.targets. This workaround generates the pdb in the output directory so the copy step is skipped. --- .../Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h index 950cd00069..fb44ee5a90 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_MSVC.h @@ -534,6 +534,7 @@ public: } bool isUsingEditAndContinue = false; + const auto pdbFilename = getOwner().getIntDirFile (config, config.getOutputFilename (".pdb", true, type == UnityPlugIn)); { auto* cl = group->createNewChildElement ("ClCompile"); @@ -559,7 +560,7 @@ public: cl->createNewChildElement ("PrecompiledHeader")->addTextElement ("NotUsing"); cl->createNewChildElement ("AssemblerListingLocation")->addTextElement ("$(IntDir)\\"); cl->createNewChildElement ("ObjectFileName")->addTextElement ("$(IntDir)\\"); - cl->createNewChildElement ("ProgramDataBaseFileName")->addTextElement ("$(IntDir)\\"); + cl->createNewChildElement ("ProgramDataBaseFileName")->addTextElement (pdbFilename); cl->createNewChildElement ("WarningLevel")->addTextElement ("Level" + String (config.getWarningLevel())); cl->createNewChildElement ("SuppressStartupBanner")->addTextElement ("true"); cl->createNewChildElement ("MultiProcessorCompilation")->addTextElement (config.shouldUseMultiProcessorCompilation() ? "true" : "false"); @@ -605,7 +606,7 @@ public: link->createNewChildElement ("IgnoreSpecificDefaultLibraries")->addTextElement (isDebug ? "libcmt.lib; msvcrt.lib;;%(IgnoreSpecificDefaultLibraries)" : "%(IgnoreSpecificDefaultLibraries)"); link->createNewChildElement ("GenerateDebugInformation")->addTextElement ((isDebug || config.shouldGenerateDebugSymbols()) ? "true" : "false"); - link->createNewChildElement ("ProgramDatabaseFile")->addTextElement (getOwner().getIntDirFile (config, config.getOutputFilename (".pdb", true, type == UnityPlugIn))); + link->createNewChildElement ("ProgramDatabaseFile")->addTextElement (pdbFilename); link->createNewChildElement ("SubSystem")->addTextElement (type == ConsoleApp ? "Console" : "Windows"); if (! config.is64Bit())