Commit ccc67626 authored by Russell Greene's avatar Russell Greene
Browse files

CPack: Allow generators to specify if they want debug info to stop stripping

add newline
parent 7bfefcc1
Pipeline #238286 waiting for manual action with stages
in 5 minutes and 24 seconds
......@@ -897,3 +897,17 @@ std::string cmCPackDebGenerator::GetComponentInstallDirNameSuffix(
}
return componentName;
}
bool cmCPackDebGenerator::HasDebugInfoRequested(
const std::string& component) const
{
// check the per-component variable first
auto debuginfoPackageVar = "CPACK_DEBIAN_" +
cmSystemTools::UpperCase(component) + "_DEBUGINFO_PACKAGE";
if (this->GetOption(debuginfoPackageVar) != nullptr) {
return this->IsOn(debuginfoPackageVar);
}
// then check the default
return this->IsOn("CPACK_DEBIAN_DEBUGINFO_PACAKGE");
}
......@@ -61,6 +61,7 @@ protected:
bool SupportsComponentInstallation() const override;
std::string GetComponentInstallDirNameSuffix(
const std::string& componentName) override;
bool HasDebugInfoRequested(const std::string& componentName) const override;
private:
bool createDebPackages();
......
......@@ -870,7 +870,9 @@ int cmCPackGenerator::InstallCMakeProject(
// strip on TRUE, ON, 1, one or several file names, but not on
// FALSE, OFF, 0 and an empty string
if (!cmIsOff(this->GetOption("CPACK_STRIP_FILES"))) {
// Don't strip the pacakge if it wants debuginfo for the packaging stage
if (!cmIsOff(this->GetOption("CPACK_STRIP_FILES") &&
!this->HasDebugInfoRequested(component))) {
mf.AddDefinition("CMAKE_INSTALL_DO_STRIP", "1");
}
// Remember the list of files before installation
......@@ -1649,3 +1651,9 @@ cmCPackComponentGroup* cmCPackGenerator::GetComponentGroup(
}
return group;
}
bool cmCPackGenerator::HasDebugInfoRequestor(
const std::string& /*component*/) const
{
return false;
}
......@@ -253,6 +253,13 @@ protected:
virtual cmCPackComponentGroup* GetComponentGroup(
const std::string& projectName, const std::string& name);
/**
* Does the generator want debug info to be passed into it, perhaps
* to generate a separate debuginfo package? Used to control if the
* CMake install process strips the binaries
*/
virtual bool HasDebugInfoRequested() const;
cmSystemTools::OutputOption GeneratorVerbose;
std::string Name;
......
......@@ -438,3 +438,17 @@ std::string cmCPackRPMGenerator::GetComponentInstallDirNameSuffix(
}
return componentName;
}
bool cmCPackRPMGenerator::HasDebugInfoRequested(
const std::string& component) const
{
// check the per-component variable first
auto debuginfoPackageVar =
"CPACK_RPM_" + cmSystemTools::UpperCase(component) + "_DEBUGINFO_PACKAGE";
if (this->GetOption(debuginfoPackageVar) != nullptr) {
return this->IsOn(debuginfoPackageVar);
}
// then check the default
return this->IsOn("CPACK_RPM_DEBUGINFO_PACAKGE");
}
......@@ -64,6 +64,7 @@ protected:
bool SupportsComponentInstallation() const override;
std::string GetComponentInstallDirNameSuffix(
const std::string& componentName) override;
bool HasDebugInfoRequested(const std::string& componentName) const override;
void AddGeneratedPackageNames();
};
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment