Skip to content

Commit 4f44d44

Browse files
committed
Still need SWT_TESTING_LIBRARY_VERSION
1 parent 39b854d commit 4f44d44

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Package.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,12 @@ extension Array where Element == PackageDescription.CXXSetting {
470470

471471
// Capture the testing library's commit info as C++ constants.
472472
if let git {
473+
let testingLibraryVersion = if let tag = git.currentTag {
474+
result.append(.define("SWT_TESTING_LIBRARY_VERSION", to: #""\#(testingLibraryVersion)""#))
475+
} else {
476+
result.append(.define("SWT_TESTING_LIBRARY_VERSION", to: "0"))
477+
}
478+
473479
result.append(.define("SWT_TESTING_LIBRARY_COMMIT_HASH", to: #""\#(git.currentCommit)""#))
474480
if git.hasUncommittedChanges {
475481
result.append(.define("SWT_TESTING_LIBRARY_COMMIT_MODIFIED", to: "1"))

0 commit comments

Comments
 (0)