Skip to content

Commit

Permalink
Update manifest to tools version 5
Browse files Browse the repository at this point in the history
This updates the manifest to tools version 5 so we can use the new API
for setting linker flags. There is also a version-specific manifest for
older Swift 4.2 clients.

(cherry picked from commit c7333ce)
  • Loading branch information
aciidgh committed Jun 22, 2019
1 parent 4f77fc4 commit f1c9ad9
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
// swift-tools-version:4.0
// swift-tools-version:5.0

// This file defines Swift package manager support for llbuild. See:
// https://github.com/apple/swift-package-manager/tree/master/Documentation
//
// You can build using:
//
// ```shell
// swift build -Xlinker -lsqlite3 -Xlinker -lncurses $(utils/generate-version-h.sh)
// ```

import PackageDescription

Expand Down Expand Up @@ -61,7 +55,8 @@ let package = Package(
.target(
name: "llbuildCore",
dependencies: ["llbuildBasic"],
path: "lib/Core"
path: "lib/Core",
linkerSettings: [.linkedLibrary("sqlite3")]
),
.target(
name: "llbuildBuildSystem",
Expand Down Expand Up @@ -117,7 +112,8 @@ let package = Package(

.target(
name: "llvmSupport",
path: "lib/llvm/Support"
path: "lib/llvm/Support",
linkerSettings: [.linkedLibrary("ncurses")]
),
],
cxxLanguageStandard: .cxx14
Expand Down
123 changes: 123 additions & 0 deletions Package@swift-4.2.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
// swift-tools-version:4.2.0

// This file defines Swift package manager support for llbuild. See:
// https://github.com/apple/swift-package-manager/tree/master/Documentation

import PackageDescription

let package = Package(
name: "llbuild",
products: [
.library(
name: "libllbuild",
targets: ["libllbuild"]),
.library(
name: "llbuildSwift",
targets: ["llbuildSwift"]),
],
targets: [
/// The llbuild testing tool.
.target(
name: "llbuild",
dependencies: ["llbuildCommands"],
path: "products/llbuild"
),

/// The custom build tool used by the Swift package manager.
.target(
name: "swift-build-tool",
dependencies: ["llbuildBuildSystem"],
path: "products/swift-build-tool"
),

/// The custom build tool used by the Swift package manager.
.target(
name: "llbuildSwift",
dependencies: ["libllbuild"],
path: "products/llbuildSwift",
exclude: ["llbuild.swift"]
),

/// The public llbuild API.
.target(
name: "libllbuild",
dependencies: ["llbuildCore", "llbuildBuildSystem"],
path: "products/libllbuild"
),

// MARK: Components

.target(
name: "llbuildBasic",
dependencies: ["llvmSupport"],
path: "lib/Basic"
),
.target(
name: "llbuildCore",
dependencies: ["llbuildBasic"],
path: "lib/Core"
),
.target(
name: "llbuildBuildSystem",
dependencies: ["llbuildCore"],
path: "lib/BuildSystem"
),
.target(
name: "llbuildNinja",
dependencies: ["llbuildBasic"],
path: "lib/Ninja"
),
.target(
name: "llbuildCommands",
dependencies: ["llbuildCore", "llbuildBuildSystem", "llbuildNinja"],
path: "lib/Commands"
),

// MARK: Test Targets

.target(
name: "llbuildBasicTests",
dependencies: ["llbuildBasic", "gtest"],
path: "unittests/Basic"),
.target(
name: "llbuildCoreTests",
dependencies: ["llbuildCore", "gtest"],
path: "unittests/Core"),
.target(
name: "llbuildBuildSystemTests",
dependencies: ["llbuildBuildSystem", "gtest"],
path: "unittests/BuildSystem"),
.target(
name: "llbuildNinjaTests",
dependencies: ["llbuildNinja", "gtest"],
path: "unittests/Ninja"),

// MARK: GoogleTest

.target(
name: "gtest",
path: "utils/unittest/googletest/src",
exclude: [
"gtest-death-test.cc",
"gtest-filepath.cc",
"gtest-port.cc",
"gtest-printers.cc",
"gtest-test-part.cc",
"gtest-typed-test.cc",
"gtest.cc",
]),

// MARK: Ingested LLVM code.
.target(
name: "llvmDemangle",
path: "lib/llvm/Demangle"
),

.target(
name: "llvmSupport",
dependencies: ["llvmDemangle"],
path: "lib/llvm/Support"
),
],
cxxLanguageStandard: .cxx14
)

0 comments on commit f1c9ad9

Please sign in to comment.