Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to parse build settings for 'OTHER_CFLAGS' when contains '$(inherited)' #756

Open
menttofly opened this issue Apr 23, 2020 · 1 comment

Comments

@menttofly
Copy link

menttofly commented Apr 23, 2020

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:

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
@VincentChow
Copy link

same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants