From 50710140da57734cab9f692cd6f1a4e4b59327d5 Mon Sep 17 00:00:00 2001 From: Lemaire Stewart Date: Sat, 27 Jan 2024 21:19:27 -0500 Subject: [PATCH] Adds support for `use_frameworks!` RE: https://github.com/star-micronics/react-native-star-io10/issues/90 --- ios/StarIo10.xcodeproj/project.pbxproj | 2 ++ react-native-star-io10.podspec | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ios/StarIo10.xcodeproj/project.pbxproj b/ios/StarIo10.xcodeproj/project.pbxproj index b8211c0a..abcdbec1 100644 --- a/ios/StarIo10.xcodeproj/project.pbxproj +++ b/ios/StarIo10.xcodeproj/project.pbxproj @@ -367,6 +367,7 @@ 58B511F01A9E6C8500147676 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; "EXCLUDED_ARCHS[sdk=iphoneos*]" = x86_64; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; "EXCLUDED_SOURCE_FILE_NAMES[sdk=iphoneos*]" = "$(SRCROOT)/../../node_modules/react-native-star-io10/ios/libs/StarIO10.xcframework/ios-arm64_x86_64-simulator/*.*"; @@ -402,6 +403,7 @@ 58B511F11A9E6C8500147676 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; EXCLUDED_ARCHS = x86_64; EXCLUDED_SOURCE_FILE_NAMES = "$(SRCROOT)/../../node_modules/react-native-star-io10/ios/libs/StarIO10.xcframework/ios-arm64_x86_64-simulator/*.*"; FRAMEWORK_SEARCH_PATHS = ( diff --git a/react-native-star-io10.podspec b/react-native-star-io10.podspec index c08d3655..611d2c2d 100644 --- a/react-native-star-io10.podspec +++ b/react-native-star-io10.podspec @@ -20,7 +20,7 @@ Pod::Spec.new do |s| s.requires_arc = true s.dependency "React" - s.pod_target_xcconfig = { + s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphoneos*]' => 'x86_64', 'EXCLUDED_SOURCE_FILE_NAMES[sdk=iphoneos*]' => '$(SRCROOT)/../../node_modules/react-native-star-io10/ios/libs/StarIO10.xcframework/ios-arm64_x86_64-simulator/*.*', 'FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]' => '$(SRCROOT)/libs/** $(SRCROOT)/../../node_modules/react-native-star-io10/ios/libs $(SRCROOT)/../../node_modules/react-native-star-io10/ios/libs/StarIO10.xcframework/ios-arm64', @@ -29,6 +29,20 @@ Pod::Spec.new do |s| # ... # s.dependency "..." + if ENV['USE_FRAMEWORKS'] + header_search_path = [ + '$(SRCROOT)/../../node_modules/react/** $(SRCROOT)/../../node_modules/react-native/**' + ] + + exclude_source_file_name = [ + 'libs/StarIO10.xcframework/ios-arm64_x86_64-simulator/StarIO10.framework/Headers/*.h libs/StarIO10.xcframework/ios-arm64_x86_64-simulator/StarIO10.framework/PrivateHeaders/*.h' + ] + + s.pod_target_xcconfig = { + "HEADER_SEARCH_PATHS" => header_search_path.join(" "), + "EXCLUDED_SOURCE_FILE_NAMES" => exclude_source_file_name.join(" ") + } + end + s.vendored_frameworks = 'ios/libs/StarIO10.xcframework' end -