1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2025 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
(
{
Domain = generic-unix;
Identifier = com.apple.pbx.linkers.libtool;
Type = Linker;
Name = "Libtool";
Description = "Create a static library using ar";
IsAbstract = Yes;
BinaryFormats = (mach-o); // TODO Use elf instead of mach-o
// 'special-args' includes the input files
CommandLine = "$(AR) rcs $(OutputPath) [options] [special-args]";
RuleName = "Libtool $(OutputPath) $(variant) $(arch)";
CommandIdentifier = "create:$(OutputPath)";
ExecDescription = "Create static library $(OutputFile:file)";
ProgressDescription = "Creating static library";
InputFileTypes = (
// TODO: elf files instead
compiled.mach-o.objfile
);
Outputs = (
// We're a linker-like task, so we expect to be given an output path in 'OutputPath'.
"$(OutputPath)"
);
CommandOutputParser = XCGccCommandOutputParser;
Options = (
// AR
{
Name = AR;
Type = Path;
DefaultValue = "$(__AR_VALUE__$(ALTERNATE_LINKER):default=ar-$(ALTERNATE_LINKER))";
},
{
Name = __AR_VALUE__;
Type = String;
DefaultValue = "ar";
},
// Used to lookup tool info
{ Name = LIBTOOL;
Type = Path;
DefaultValue = "$(AR)";
},
// Input file lists
{
Name = __INPUT_FILE_LIST_PATH__;
Type = Path;
// this is set up for us as a read-only property
Condition = "$(LIBTOOL_USE_RESPONSE_FILE)";
DefaultValue = "$(LINK_FILE_LIST_$(variant)_$(arch))";
CommandLineArgs = (
"@$(value)",
);
IsInputDependency = Yes;
},
{
Name = "LIBTOOL_USE_RESPONSE_FILE";
Type = Boolean;
DefaultValue = YES;
},
);
},
)
|