mirror of
https://github.com/intel/llvm.git
synced 2026-01-22 23:49:22 +08:00
[InstallAPI] capture compatibility versions (#85261)
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
// RUN: split-file %s %t
|
||||
/// Check basic arguments are captured.
|
||||
// RUN: clang-installapi -x objective-c -target arm64-apple-ios13.0.0 \
|
||||
// RUN: -fapplication-extension -current_version 1 -install_name /usr/lib/basic.dylib \
|
||||
// RUN: -fapplication-extension -current_version 1 -compatibility_version 1 \
|
||||
// RUN: -install_name /usr/lib/basic.dylib \
|
||||
// RUN: %t/basic_inputs.json -o %t/basic.tbd 2>&1 | FileCheck %s --allow-empty
|
||||
// RUN: llvm-readtapi -compare %t/basic.tbd %t/expected.tbd 2>&1 | FileCheck %s --allow-empty
|
||||
|
||||
@@ -25,11 +26,6 @@
|
||||
//--- expected.tbd
|
||||
{
|
||||
"main_library": {
|
||||
"compatibility_versions": [
|
||||
{
|
||||
"version": "0"
|
||||
}
|
||||
],
|
||||
"install_names": [
|
||||
{
|
||||
"name": "/usr/lib/basic.dylib"
|
||||
|
||||
@@ -85,6 +85,9 @@ bool Options::processLinkerOptions(InputArgList &Args) {
|
||||
if (auto *Arg = Args.getLastArg(OPT_current__version))
|
||||
LinkerOpts.CurrentVersion.parse64(Arg->getValue());
|
||||
|
||||
if (auto *Arg = Args.getLastArg(OPT_compatibility__version))
|
||||
LinkerOpts.CompatVersion.parse64(Arg->getValue());
|
||||
|
||||
LinkerOpts.IsDylib = Args.hasArg(OPT_dynamiclib);
|
||||
|
||||
LinkerOpts.AppExtensionSafe =
|
||||
@@ -159,6 +162,7 @@ InstallAPIContext Options::createContext() {
|
||||
|
||||
Ctx.BA.InstallName = LinkerOpts.InstallName;
|
||||
Ctx.BA.CurrentVersion = LinkerOpts.CurrentVersion;
|
||||
Ctx.BA.CompatVersion = LinkerOpts.CompatVersion;
|
||||
Ctx.BA.AppExtensionSafe = LinkerOpts.AppExtensionSafe;
|
||||
Ctx.FT = DriverOpts.OutFT;
|
||||
Ctx.OutputLoc = DriverOpts.OutputPath;
|
||||
|
||||
@@ -49,6 +49,9 @@ struct LinkerOptions {
|
||||
/// \brief The current version to use for the dynamic library.
|
||||
PackedVersion CurrentVersion;
|
||||
|
||||
/// \brief The compatibility version to use for the dynamic library.
|
||||
PackedVersion CompatVersion;
|
||||
|
||||
/// \brief Is application extension safe.
|
||||
bool AppExtensionSafe = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user