Closed tristanSIF closed 2 years ago
Hi @tristanSIF , I don't think that'd be an option. Those you mention aré Build Settings
and would work fine for static but not for dynamic libraries. The latter needs also to filter Compile Sources
in Build Phases
among others. The option for this filter is macOS
and doesn't distinguish between x86_64
and arm64
.
Hi @fermoya . I'm sorry for my poor english. I mean to use these two settings to work together with this great library, as additional processing of xcconfig file.
Hi @tristanSIF , the architectures won't be possible. Changing OTHER_SWIFT_FLAGS
and HEADER_SEARCH_PATHS
should be fine, I can look into that.
The file where changes need to be made is abstract_target.rb in case you wanna give it a try.
@tristanSIF I'm not sure what you suggest is enough to use canImport
instead. I've pushed some changes to feat/issue-31
in the repo. I'm adding the sdk
clause to:
OTHER_SWIFT_FLAGS
HEADER_SEARCH_PATHS
OTHER_LDFLAGS
OTHER_SWIFT_FLAGS
But it doesn't seem to work. You can try it yourself by trying to build the Sample
project. If you want to clone the repo you can also use that code on your own project:
gem uninstall cocoapods-catalyst-support # old version
cd <path-to-catalyst-repo>
gem build cocoapods-catalyst-support.gemspec
sudo gem install cocoapods-catalyst-support-0.1.3.gem
@fermoya
I'm using use_modular_headers!
instead of use_frameworks!
in podfile and the xcconfig will be different.
The OTHER_SWIFT_FLAGS
only appears with use_modular_headers!
.
After testing the sample project, I found that there are some mis-configs when using feat/issue_31
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
OTHER_LDFLAGS[sdk=iphone*] = $(inherited) -ObjC -framework "StoreKit" -l"c++" -framework "FirebaseCoreDiagnostics" -framework "GoogleUtilities" -framework "Security" -framework "GoogleDataTransport" -framework "nanopb" -framework "FBLPromises" -framework "FirebaseCore" -framework "FirebaseAnalytics" -framework "FirebaseInstallations" -framework "GoogleAppMeasurement" -framework "GoogleAppMeasurementIdentitySupport"
OTHER_SWIFT_FLAGS[sdk=iphone*] = $(inherited) -D COCOAPODS
FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreDiagnostics" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore" "${PODS_ROOT}/FirebaseAnalytics/Frameworks" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseInstallations" "${PODS_XCFRAMEWORKS_BUILD_DIR}/FirebaseAnalytics/AdIdSupport" "${PODS_ROOT}/GoogleAppMeasurement/Frameworks" "${PODS_XCFRAMEWORKS_BUILD_DIR}/GoogleAppMeasurement/AdIdSupport" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC" "${PODS_XCFRAMEWORKS_BUILD_DIR}/AppCenter/Analytics" "${PODS_XCFRAMEWORKS_BUILD_DIR}/GoogleAppMeasurement/WithoutAdIdSupport"
HEADER_SEARCH_PATHS[sdk=iphone*] = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities/GoogleUtilities.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport/GoogleDataTransport.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb/nanopb.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC/FBLPromises.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore/FirebaseCore.framework/Headers" "${PODS_ROOT}/Headers/Public" "${PODS_TARGET_SRCROOT}/Sources/FBLPromises/include" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseInstallations/FirebaseInstallations.framework/Headers" "${PODS_ROOT}/Headers/Public/Firebase"
OTHER_LDFLAGS = $(inherited) -ObjC -l"sqlite3" -l"z" -framework "CoreTelephony" -framework "Foundation" -framework "SystemConfiguration" -framework "UIKit"
FRAMEWORK_SEARCH_PATHS = $(inherited)
HEADER_SEARCH_PATHS = $(inherited) $(inherited) ${PODS_ROOT}/Firebase/CoreOnly/Sources
OTHER_LDFLAGS[sdk=macosx*] = $(inherited) -ObjC -framework "AppCenter" -framework "AppCenterAnalytics"
OTHER_SWIFT_FLAGS[sdk=macosx*] = $(inherited) -D COCOAPODS
FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(inherited) "${PODS_ROOT}/AppCenter/AppCenter-SDK-Apple" "${PODS_XCFRAMEWORKS_BUILD_DIR}/AppCenter/Core"
HEADER_SEARCH_PATHS[sdk=macosx*] = $(inherited)
Modify FRAMEWORK_SEARCH_PATHS
is enough for swift, and HEADER_SEARCH_PATHS
for oc, which was almost done by feat/issue_31
.
And below are some misconfigurations need to be fixed.
"${PODS_XCFRAMEWORKS_BUILD_DIR}/AppCenter/Analytics"
belongs to macos, but catalyst-support
assigned it to iphone*OTHER_SWIFT_FLAGS
is not necessary when using frameworks, my badHEADER_SEARCH_PATHS = $(inherited) $(inherited) ${PODS_ROOT}/Firebase/CoreOnly/Sources
one firebase remained in HEADER_SEARCH_PATHSOTHER_SWIFT_FLAGS
from sample project's build settingsCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
HEADER_SEARCH_PATHS = $(inherited)
HEADER_SEARCH_PATHS[sdk=macosx*] = $(inherited)
HEADER_SEARCH_PATHS[sdk=iphone*] = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities/GoogleUtilities.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport/GoogleDataTransport.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb/nanopb.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC/FBLPromises.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore/FirebaseCore.framework/Headers" "${PODS_ROOT}/Headers/Public" "${PODS_TARGET_SRCROOT}/Sources/FBLPromises/include" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseInstallations/FirebaseInstallations.framework/Headers" "${PODS_ROOT}/Headers/Public/Firebase" ${PODS_ROOT}/Firebase/CoreOnly/Sources
OTHER_LDFLAGS = $(inherited) -ObjC -l"sqlite3" -l"z" -framework "CoreTelephony" -framework "Foundation" -framework "SystemConfiguration" -framework "UIKit"
OTHER_LDFLAGS[sdk=macosx*] = $(inherited) -ObjC -framework "AppCenter" -framework "AppCenterAnalytics"
OTHER_LDFLAGS[sdk=iphone*] = $(inherited) -ObjC -framework "StoreKit" -l"c++" -framework "FirebaseCoreDiagnostics" -framework "GoogleUtilities" -framework "Security" -framework "GoogleDataTransport" -framework "nanopb" -framework "FBLPromises" -framework "FirebaseCore" -framework "FirebaseAnalytics" -framework "FirebaseInstallations" -framework "GoogleAppMeasurement" -framework "GoogleAppMeasurementIdentitySupport"
FRAMEWORK_SEARCH_PATHS = $(inherited)
FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(inherited) "${PODS_ROOT}/AppCenter/AppCenter-SDK-Apple" "${PODS_XCFRAMEWORKS_BUILD_DIR}/AppCenter/Core" "${PODS_XCFRAMEWORKS_BUILD_DIR}/AppCenter/Analytics"
FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreDiagnostics" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore" "${PODS_ROOT}/FirebaseAnalytics/Frameworks" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseInstallations" "${PODS_XCFRAMEWORKS_BUILD_DIR}/FirebaseAnalytics/AdIdSupport" "${PODS_ROOT}/GoogleAppMeasurement/Frameworks" "${PODS_XCFRAMEWORKS_BUILD_DIR}/GoogleAppMeasurement/AdIdSupport" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC" "${PODS_XCFRAMEWORKS_BUILD_DIR}/GoogleAppMeasurement/WithoutAdIdSupport"
And then, canImport
works fine in swift with codes below, which will print AppCenter can be imported
with catalyst and Firebase can be imported
with ios.
class Test {
func doSth() {
#if canImport(AppCenter)
print("AppCenter can be imported")
#endif
#if canImport(Firebase)
print("Firebase can be imported")
#endif
}
}
#if __has_include(<Firebase/Firebase.h>)
NSLog(@"Firebase");
#endif
#if __has_include(<AppCenterAnalytics/AppCenterAnalytics.h>)
NSLog(@"Appcenter");
#endif
Just replace use_frameworks!
with use_modular_headers!
and pod install
.
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1
LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreDiagnostics" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseInstallations" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb"
OTHER_CFLAGS = $(inherited) -fmodule-map-file="${PODS_ROOT}/Headers/Public/FBLPromises/PromisesObjC.modulemap" -fmodule-map-file="${PODS_ROOT}/Headers/Public/FirebaseCore/FirebaseCore.modulemap" -fmodule-map-file="${PODS_ROOT}/Headers/Public/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.modulemap" -fmodule-map-file="${PODS_ROOT}/Headers/Public/FirebaseInstallations/FirebaseInstallations.modulemap" -fmodule-map-file="${PODS_ROOT}/Headers/Public/GoogleDataTransport/GoogleDataTransport.modulemap" -fmodule-map-file="${PODS_ROOT}/Headers/Public/GoogleUtilities/GoogleUtilities.modulemap" -fmodule-map-file="${PODS_ROOT}/Headers/Public/nanopb/nanopb.modulemap"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
OTHER_LDFLAGS = $(inherited) -ObjC -l"sqlite3" -l"z" -framework "CoreTelephony" -framework "Foundation" -framework "SystemConfiguration" -framework "UIKit"
OTHER_LDFLAGS[sdk=macosx*] = $(inherited) -ObjC -framework "AppCenter" -framework "AppCenterAnalytics"
OTHER_LDFLAGS[sdk=iphone*] = $(inherited) -ObjC -framework "FirebaseAnalytics" -l"FirebaseCore" -l"FirebaseCoreDiagnostics" -l"FirebaseInstallations" -framework "GoogleAppMeasurement" -l"GoogleDataTransport" -l"GoogleUtilities" -l"PromisesObjC" -l"nanopb" -framework "StoreKit" -l"c++" -framework "Security" -framework "GoogleAppMeasurementIdentitySupport"
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -Xcc -Xcc -Xcc -Xcc -Xcc -Xcc -Xcc
OTHER_SWIFT_FLAGS[sdk=macosx*] = $(inherited) -D COCOAPODS
OTHER_SWIFT_FLAGS[sdk=iphone*] = $(inherited) -D COCOAPODS -fmodule-map-file="${PODS_ROOT}/Headers/Public/FirebaseCore/FirebaseCore.modulemap" -fmodule-map-file="${PODS_ROOT}/Headers/Public/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.modulemap" -fmodule-map-file="${PODS_ROOT}/Headers/Public/FirebaseInstallations/FirebaseInstallations.modulemap" -fmodule-map-file="${PODS_ROOT}/Headers/Public/GoogleDataTransport/GoogleDataTransport.modulemap" -fmodule-map-file="${PODS_ROOT}/Headers/Public/GoogleUtilities/GoogleUtilities.modulemap" -fmodule-map-file="${PODS_ROOT}/Headers/Public/FBLPromises/PromisesObjC.modulemap" -fmodule-map-file="${PODS_ROOT}/Headers/Public/nanopb/nanopb.modulemap"
FRAMEWORK_SEARCH_PATHS = $(inherited)
FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(inherited) "${PODS_ROOT}/AppCenter/AppCenter-SDK-Apple" "${PODS_XCFRAMEWORKS_BUILD_DIR}/AppCenter/Core"
FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(inherited) "${PODS_ROOT}/FirebaseAnalytics/Frameworks" "${PODS_XCFRAMEWORKS_BUILD_DIR}/FirebaseAnalytics/AdIdSupport" "${PODS_ROOT}/GoogleAppMeasurement/Frameworks" "${PODS_XCFRAMEWORKS_BUILD_DIR}/GoogleAppMeasurement/AdIdSupport" "${PODS_XCFRAMEWORKS_BUILD_DIR}/AppCenter/Analytics" "${PODS_XCFRAMEWORKS_BUILD_DIR}/GoogleAppMeasurement/WithoutAdIdSupport"
HEADER_SEARCH_PATHS = $(inherited) $(inherited) ${PODS_ROOT}/Firebase/CoreOnly/Sources
HEADER_SEARCH_PATHS[sdk=macosx*] = $(inherited)
HEADER_SEARCH_PATHS[sdk=iphone*] = $(inherited) "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FirebaseCore" "${PODS_ROOT}/Headers/Public/FirebaseCoreDiagnostics" "${PODS_ROOT}/Headers/Public/FirebaseInstallations" "${PODS_ROOT}/Headers/Public/GoogleDataTransport" "${PODS_ROOT}/Headers/Public/GoogleUtilities" "${PODS_ROOT}/Headers/Public/PromisesObjC" "${PODS_ROOT}/Headers/Public/nanopb" "${PODS_ROOT}/Headers/Public" "${PODS_TARGET_SRCROOT}/Sources/FBLPromises/include"
"${PODS_XCFRAMEWORKS_BUILD_DIR}/AppCenter/Analytics"
belongs to macos, but catalyst-support
assigned it to iphone*-Xcc
flag is needed ahead of -fmodule-map-file
HEADER_SEARCH_PATHS = $(inherited) $(inherited) ${PODS_ROOT}/Firebase/CoreOnly/Sources
one firebase remained in HEADER_SEARCH_PATHSThen the above code also works properly.
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1
LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCore" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseCoreDiagnostics" "${PODS_CONFIGURATION_BUILD_DIR}/FirebaseInstallations" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleDataTransport" "${PODS_CONFIGURATION_BUILD_DIR}/GoogleUtilities" "${PODS_CONFIGURATION_BUILD_DIR}/PromisesObjC" "${PODS_CONFIGURATION_BUILD_DIR}/nanopb"
OTHER_CFLAGS = $(inherited) -fmodule-map-file="${PODS_ROOT}/Headers/Public/FBLPromises/PromisesObjC.modulemap" -fmodule-map-file="${PODS_ROOT}/Headers/Public/FirebaseCore/FirebaseCore.modulemap" -fmodule-map-file="${PODS_ROOT}/Headers/Public/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.modulemap" -fmodule-map-file="${PODS_ROOT}/Headers/Public/FirebaseInstallations/FirebaseInstallations.modulemap" -fmodule-map-file="${PODS_ROOT}/Headers/Public/GoogleDataTransport/GoogleDataTransport.modulemap" -fmodule-map-file="${PODS_ROOT}/Headers/Public/GoogleUtilities/GoogleUtilities.modulemap" -fmodule-map-file="${PODS_ROOT}/Headers/Public/nanopb/nanopb.modulemap"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
OTHER_LDFLAGS = $(inherited) -ObjC -l"sqlite3" -l"z" -framework "CoreTelephony" -framework "Foundation" -framework "SystemConfiguration" -framework "UIKit"
OTHER_LDFLAGS[sdk=macosx*] = $(inherited) -ObjC -framework "AppCenter" -framework "AppCenterAnalytics"
OTHER_LDFLAGS[sdk=iphone*] = $(inherited) -ObjC -framework "FirebaseAnalytics" -l"FirebaseCore" -l"FirebaseCoreDiagnostics" -l"FirebaseInstallations" -framework "GoogleAppMeasurement" -l"GoogleDataTransport" -l"GoogleUtilities" -l"PromisesObjC" -l"nanopb" -framework "StoreKit" -l"c++" -framework "Security" -framework "GoogleAppMeasurementIdentitySupport"
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
OTHER_SWIFT_FLAGS[sdk=macosx*] = $(inherited)
OTHER_SWIFT_FLAGS[sdk=iphone*] = $(inherited) -Xcc -fmodule-map-file="${PODS_ROOT}/Headers/Public/FirebaseCore/FirebaseCore.modulemap" -Xcc -fmodule-map-file="${PODS_ROOT}/Headers/Public/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.modulemap" -Xcc -fmodule-map-file="${PODS_ROOT}/Headers/Public/FirebaseInstallations/FirebaseInstallations.modulemap" -Xcc -fmodule-map-file="${PODS_ROOT}/Headers/Public/GoogleDataTransport/GoogleDataTransport.modulemap" -Xcc -fmodule-map-file="${PODS_ROOT}/Headers/Public/GoogleUtilities/GoogleUtilities.modulemap" -Xcc -fmodule-map-file="${PODS_ROOT}/Headers/Public/FBLPromises/PromisesObjC.modulemap" -Xcc -fmodule-map-file="${PODS_ROOT}/Headers/Public/nanopb/nanopb.modulemap"
FRAMEWORK_SEARCH_PATHS = $(inherited)
FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(inherited) "${PODS_ROOT}/AppCenter/AppCenter-SDK-Apple" "${PODS_XCFRAMEWORKS_BUILD_DIR}/AppCenter/Core" "${PODS_XCFRAMEWORKS_BUILD_DIR}/AppCenter/Analytics"
FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(inherited) "${PODS_ROOT}/FirebaseAnalytics/Frameworks" "${PODS_XCFRAMEWORKS_BUILD_DIR}/FirebaseAnalytics/AdIdSupport" "${PODS_ROOT}/GoogleAppMeasurement/Frameworks" "${PODS_XCFRAMEWORKS_BUILD_DIR}/GoogleAppMeasurement/AdIdSupport" "${PODS_XCFRAMEWORKS_BUILD_DIR}/GoogleAppMeasurement/WithoutAdIdSupport"
HEADER_SEARCH_PATHS = $(inherited)
HEADER_SEARCH_PATHS[sdk=macosx*] = $(inherited)
HEADER_SEARCH_PATHS[sdk=iphone*] = $(inherited) "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FirebaseCore" "${PODS_ROOT}/Headers/Public/FirebaseCoreDiagnostics" "${PODS_ROOT}/Headers/Public/FirebaseInstallations" "${PODS_ROOT}/Headers/Public/GoogleDataTransport" "${PODS_ROOT}/Headers/Public/GoogleUtilities" "${PODS_ROOT}/Headers/Public/PromisesObjC" "${PODS_ROOT}/Headers/Public/nanopb" "${PODS_ROOT}/Headers/Public" "${PODS_TARGET_SRCROOT}/Sources/FBLPromises/include" ${PODS_ROOT}/Firebase/CoreOnly/Sources
Hi @tristanSIF thanks for clarifying, I didn't know you needed to use use_modular_headers!
instead.
Does that mean that it works as expected and you're happy with the work done in that branch?
@fermoya Version 2.0 is superb, and it works exactly as I expected in Swift.
However, I have encountered some problems in oc, both with use_frameworks!
and use_modular_headers!
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Firebase" $(inherited) ${PODS_ROOT}/Firebase/CoreOnly/Sources "${PODS_TARGET_SRCROOT}/Sources/FBLPromises/include"
Firebase and FBLPromises are only used by Firebase and should be moved to iphone*
I've no idea if we can just remove "${PODS_ROOT}/Headers/Public"
. If it keeps, #if __has_include(<Firebase/Firebase.h>)
will always be true.
I pushed new changes @tristanSIF , it should be all good now hopefully. It compiles for both Mac
and arm64
no matter if use_frameworks!
or use_modular_headers!
@fermoya I still have questions about "${PODS_ROOT}/Headers/Public"
, which is auto-generated and added to HEADER_SEARCH_PATHS
by cocoapods.
I am not sure if the following words are correct, and I'm not sure if removing it will have any side effects.
In my opinion, this directory is created just as a container for placing libraries' header files, which are placed in sub-directories. And no header files placed in root of Public. These sub-directories will also be added to HEADER_SEARCH_PATHS
so we can import files from sub-directories directly. Therefore, "${PODS_ROOT}/Headers/Public"
is not necessary in HEADER_SEARCH_PATHS
.
On the other hand, compiler will be able to find the header file if we keep Public
in search paths, and #if __has_include(<Firebase/Firebase.h>)
will always be true as the file actually exists, so we have no method to do same thing like canImport
in OC.
So, I think we can just remove it from paths, to make #if __has_include(<Firebase/Firebase.h>)
available in OC.
@tristanSIF I'm not so sure you can just remove "${PODS_ROOT}/Headers/Public"
. It's not necessary for this particular Sample
project but it might be the case that some other pod
that you wanna keep requires that particular path to import some Public
header. Removing it would surely cause a compilation error.
Those headers should've been marked as macOS
in the Pods.xcproject
Build Phases. Otherwise, that might be a possible cause of the problem.
No questions any more. Thank you so very much.
Greetings!
i think we can separate modulemap and headers_search_path in pod's xcconfig file either. With these, we can use
#if canImport(IQKeyboardManager)
in swift and#if __has_include("IQKeyboardManager.h")
in oc, instead of using#if !targetEnviroment(macCatalyst)
, for more clarity and supports more platformsto
And besides, i'm wondering if we can specify archs which results in