I'm trying to create an iOS project that includes C code that is shared across other platforms (Android). Some of the third party libraries I'm compiling rely on having certain directories included as search paths. However, no matter what I've tried, I've been unable to the CocoaPods .podspec file to include a given directory in the compilation search path.
Whilst this is a Flutter plugin, it's my understanding that this is an issue with CocoaPods/Xcode, since Flutter has merely set up the project files. However, it's worth noting that Flutter sets up an example workspace, which I do not want to modify. I want the Plugin itself to be modified to compile in the requisite code, not the example workspace/project. In case it matters, I used the following Flutter command to create the project:
flutter create -t plugin -i objc -a java repro_cocoapods_issue
I have a full repro up on GitHub here. To reproduce, open the workspace at example/ios/Runner.xcworkspace in Xcode and try to build.
These are the things I've tried in the ios/repro_cocoapods_issue.podspec file:
s.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PROJECT_DIR}/external/"'}s.xcconfig = { 'USER_HEADER_SEARCH_PATHS' => '"${PROJECT_DIR}/external/"'}s.user_target_xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PROJECT_DIR}/external/"'}s.user_target_xcconfig = { 'USER_HEADER_SEARCH_PATHS' => '"${PROJECT_DIR}/external/"'}s.pod_target_xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PROJECT_DIR}/external/"'}s.pod_target_xcconfig = { 'USER_HEADER_SEARCH_PATHS' => '"${PROJECT_DIR}/external/"'}s.compiler_flags = '-Iexternal/'s.preserve_paths = 'external/**'s.preserve_paths = '${PROJECT_DIR}/external/**'
In all cases, I get:
'external_dir.c' file not found
If I change the code to #include ../external/external_dir.c then it works, but this does not help with my actual use case.
How can I configure my podspec so that a specified directory is included in the search path during compilation?
from Including a directory as a search path during compilation with CocoaPods
No comments:
Post a Comment