CocoaPods / CocoaPods/Xcodeproj
Unable to parse build settings for 'OTHER_CFLAGS' when contains '$(inherited)'
- Dominant language
- Ruby
- Stars
- 2.4k
- Forks
- 488
- PR merge metrics
- No merged PRs in 30d
Description
I want to add new flag for 'OTHER_CFLAGS', however the build_settings['OTHER_CFLAGS'] return nil because the exist of '$(inherited)' flag. If I remove this flag and add other flag, everything works great and I got an array for 'OTHER_CFLAGS'. But in other cases for example 'OTHER_LDFLAGS', I got the correct result. Here is my code:
```ruby
def run(project_path, repo_dir)
project = Xcodeproj::Project.open(project_path)
gaoding_targets = gaoding_targets(repo_dir)
clang_flag = '-fsanitize-coverage=func,trace-pc-guard'
project.targets.each do |target|
next unless gaoding_targets.include?(target.name)
target.build_configurations.each do |config|
if ARGV[1] == 'use'
config.build_settings['OTHER_CFLAGS'] = clang_flag
else
config.build_settings['OTHER_CFLAGS'] = ''
end
end
end
project.save
end
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.