From 1029c2d45e30dfa96133e38b84350c21c45c9391 Mon Sep 17 00:00:00 2001 From: krypt-lx <147344502+krypt-lx@users.noreply.github.com> Date: Mon, 8 Apr 2024 22:16:29 +0200 Subject: [PATCH] fix: Added Obj-C support check in generated bundle header files (#999) This commit adds check for presence of ObjC support in currently used compiler. If not, skips SWIFTPM_MODULE_BUNDLE macros altogether. fixes https://github.com/cgrindel/rules_swift_package_manager/issues/998 Co-authored-by: Krypt Co-authored-by: Chuck Grindel --- swiftpkg/internal/ObjcResourceBundleAccessor.h.tmpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/swiftpkg/internal/ObjcResourceBundleAccessor.h.tmpl b/swiftpkg/internal/ObjcResourceBundleAccessor.h.tmpl index 6f3666476..801e63f08 100644 --- a/swiftpkg/internal/ObjcResourceBundleAccessor.h.tmpl +++ b/swiftpkg/internal/ObjcResourceBundleAccessor.h.tmpl @@ -1,3 +1,4 @@ +#ifdef __OBJC__ #import #if __cplusplus @@ -11,3 +12,4 @@ NSBundle* {MODULE_NAME}_SWIFTPM_MODULE_BUNDLE(void); #if __cplusplus } #endif +#endif