📜  #ifdef in podfile - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:26.941000             🧑  作者: Mango

代码示例1
# Inject the target macro.
# http://stackoverflow.com/a/27138078/1677041
post_install do |installer|
    installer.pods_project.targets.each do |target|
        if target.name == "foo_target_name"
            target.build_configurations.each do |config|
                config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
                config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'ADHOC=1'
            end
            puts "\n\e[3m\e[32mInject a macro ADHOC to target!\e[0m\e[23m\n\n"
        end
    end
end