mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
AIX: Add an option to disable automatic exports from shared libraries
Since commit 0f150b69d3 (AIX: Explicitly compute shared object exports
for both XL and GNU, 2019-07-11, v3.16.0-rc1~418^2~2) we always export
all symbols from shared libraries by default. Add a new target property
called `AIX_EXPORT_ALL_SYMBOLS` that can be explicitly set to OFF to
suppress this behavior and export no symbols by default.
Fixes: #20290
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include "cmSourceFile.h"
|
||||
#include "cmStateTypes.h"
|
||||
#include "cmStringAlgorithms.h"
|
||||
#include "cmTarget.h"
|
||||
|
||||
cmCommonTargetGenerator::cmCommonTargetGenerator(cmGeneratorTarget* gt)
|
||||
: GeneratorTarget(gt)
|
||||
@@ -216,6 +217,20 @@ std::string cmCommonTargetGenerator::GetManifests(const std::string& config)
|
||||
return cmJoin(manifests, " ");
|
||||
}
|
||||
|
||||
std::string cmCommonTargetGenerator::GetAIXExports(std::string const&)
|
||||
{
|
||||
std::string aixExports;
|
||||
if (this->GeneratorTarget->Target->IsAIX()) {
|
||||
if (const char* exportAll =
|
||||
this->GeneratorTarget->GetProperty("AIX_EXPORT_ALL_SYMBOLS")) {
|
||||
if (cmIsOff(exportAll)) {
|
||||
aixExports = "-n";
|
||||
}
|
||||
}
|
||||
}
|
||||
return aixExports;
|
||||
}
|
||||
|
||||
void cmCommonTargetGenerator::AppendOSXVerFlag(std::string& flags,
|
||||
const std::string& lang,
|
||||
const char* name, bool so)
|
||||
|
||||
Reference in New Issue
Block a user