The compiler_flags attribute in pod specs are ignored by cocoapods-bazel, which can result in that pod failing to build under Bazel. For example, the CNIODarwin pod requires -D__APPLE_USE_RFC_3542=1 in order to compile successfully on macOS.
The following addition to the Podfile serves as a temporary workaround:
pre_install do |installer|
cniodarwin = installer.pod_targets.detect { |t| t.name == 'CNIODarwin' }
cniodarwin.spec_consumers.each do |c|
compiler_flags = c.spec.attributes_hash['compiler_flags']
c.spec.attributes_hash['pod_target_xcconfig'] = {'OTHER_CFLAGS' => compiler_flags}
end
end
The
compiler_flags
attribute in pod specs are ignored by cocoapods-bazel, which can result in that pod failing to build under Bazel. For example, the CNIODarwin pod requires-D__APPLE_USE_RFC_3542=1
in order to compile successfully on macOS.The following addition to the Podfile serves as a temporary workaround: