Fix default PDB output directory (#13644)
The ComputePDBOutputDir added by commit 3f60dbf1
(Add
PDB_OUTPUT_DIRECTORY and PDB_NAME target properties, 2012-09-25) falls
back to the current binary directory instead of the target output
directory as before. When no PDB_OUTPUT_DIRECTORY property is set we
instead should fall back to the target output directory where .pdb files
used to go before the new property was added.
This commit is contained in:
parent
a7742140ad
commit
f309366873
|
@ -2584,7 +2584,10 @@ cmTarget::OutputInfo const* cmTarget::GetOutputInfo(const char* config)
|
||||||
OutputInfo info;
|
OutputInfo info;
|
||||||
this->ComputeOutputDir(config, false, info.OutDir);
|
this->ComputeOutputDir(config, false, info.OutDir);
|
||||||
this->ComputeOutputDir(config, true, info.ImpDir);
|
this->ComputeOutputDir(config, true, info.ImpDir);
|
||||||
this->ComputePDBOutputDir(config, info.PdbDir);
|
if(!this->ComputePDBOutputDir(config, info.PdbDir))
|
||||||
|
{
|
||||||
|
info.PdbDir = info.OutDir;
|
||||||
|
}
|
||||||
OutputInfoMapType::value_type entry(config_upper, info);
|
OutputInfoMapType::value_type entry(config_upper, info);
|
||||||
i = this->Internal->OutputInfoMap.insert(entry).first;
|
i = this->Internal->OutputInfoMap.insert(entry).first;
|
||||||
}
|
}
|
||||||
|
@ -3940,7 +3943,7 @@ bool cmTarget::ComputeOutputDir(const char* config,
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmTarget::ComputePDBOutputDir(const char* config, std::string& out)
|
bool cmTarget::ComputePDBOutputDir(const char* config, std::string& out)
|
||||||
{
|
{
|
||||||
// Look for a target property defining the target output directory
|
// Look for a target property defining the target output directory
|
||||||
// based on the target type.
|
// based on the target type.
|
||||||
|
@ -3980,8 +3983,7 @@ void cmTarget::ComputePDBOutputDir(const char* config, std::string& out)
|
||||||
}
|
}
|
||||||
if(out.empty())
|
if(out.empty())
|
||||||
{
|
{
|
||||||
// Default to the current output directory.
|
return false;
|
||||||
out = ".";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert the output path to a full path in case it is
|
// Convert the output path to a full path in case it is
|
||||||
|
@ -3996,6 +3998,7 @@ void cmTarget::ComputePDBOutputDir(const char* config, std::string& out)
|
||||||
this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->
|
this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->
|
||||||
AppendDirectoryForConfig("/", config, "", out);
|
AppendDirectoryForConfig("/", config, "", out);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
|
@ -577,7 +577,7 @@ private:
|
||||||
struct OutputInfo;
|
struct OutputInfo;
|
||||||
OutputInfo const* GetOutputInfo(const char* config);
|
OutputInfo const* GetOutputInfo(const char* config);
|
||||||
bool ComputeOutputDir(const char* config, bool implib, std::string& out);
|
bool ComputeOutputDir(const char* config, bool implib, std::string& out);
|
||||||
void ComputePDBOutputDir(const char* config, std::string& out);
|
bool ComputePDBOutputDir(const char* config, std::string& out);
|
||||||
|
|
||||||
// Cache import information from properties for each configuration.
|
// Cache import information from properties for each configuration.
|
||||||
struct ImportInfo;
|
struct ImportInfo;
|
||||||
|
|
Loading…
Reference in New Issue