Skip to content

Commit 54e7cec

Browse files
committed
Added version check to make-pkgconfig
1 parent 3b17e85 commit 54e7cec

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

utils/make-pkgconfig.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,19 @@ func makeFile() throws {
5858
/// Extract the info we need from llvm-config
5959

6060
print("Found llvm-config at \(llvmConfig)...")
61-
print("Running llvm-config --libs all...")
62-
let ldFlags = run(llvmConfig, args: ["--libs", "all"])!
63-
.replacing(charactersIn: .newlines, with: "")
61+
6462
print("Running llvm-config --version...")
6563
let version = run(llvmConfig, args: ["--version"])!
6664
.replacing(charactersIn: .newlines, with: "")
6765

66+
guard version.hasPrefix("3.9") else {
67+
throw "LLVMSwift requires LLVM version >=3.9.0, but you have \(version)"
68+
}
69+
70+
print("Running llvm-config --libs all...")
71+
let ldFlags = run(llvmConfig, args: ["--libs", "all"])!
72+
.replacing(charactersIn: .newlines, with: "")
73+
6874
// SwiftPM has a whitelisted set of cflags that it understands, and
6975
// unfortunately that includes almost everything but the include dir.
7076

0 commit comments

Comments
 (0)