From 5a7ae447e0edadaa192181d40664c3e513820fa6 Mon Sep 17 00:00:00 2001 From: axxel Date: Tue, 31 Dec 2024 17:42:48 +0100 Subject: [PATCH] ci: fix Swift package build regression --- Package.swift | 2 +- core/src/ZXingC.cpp | 5 +++++ core/src/ZXingCpp.cpp | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index b514af7cd4..5faf571d10 100644 --- a/Package.swift +++ b/Package.swift @@ -15,7 +15,7 @@ let package = Package( .target( name: "ZXingCppCore", path: "core/src", - exclude: ["libzint"], + exclude: ["libzint", "ZXingC.cpp", "ZXingCpp.cpp"], publicHeadersPath: ".", cxxSettings: [ .define("ZXING_READERS") diff --git a/core/src/ZXingC.cpp b/core/src/ZXingC.cpp index 3327abe6a8..9f2d342ecf 100644 --- a/core/src/ZXingC.cpp +++ b/core/src/ZXingC.cpp @@ -7,7 +7,12 @@ #include "ZXingC.h" #include "ZXingCpp.h" + +#if __has_include("Version.h") #include "Version.h" +#else // this is mainly a workaround for a missing autogenerated Version.h in the XCode/CocoaPods corner +#define ZXING_VERSION_STR "undefined" +#endif #include #include diff --git a/core/src/ZXingCpp.cpp b/core/src/ZXingCpp.cpp index 782c5fc842..d5fa34609b 100644 --- a/core/src/ZXingCpp.cpp +++ b/core/src/ZXingCpp.cpp @@ -5,7 +5,11 @@ #include "ZXingCpp.h" +#if __has_include("Version.h") #include "Version.h" +#else // this is mainly a workaround for a missing autogenerated Version.h in the XCode/CocoaPods corner +#define ZXING_VERSION_STR "undefined" +#endif namespace ZXing {