Rightpoint / RZBluetooth

Core Bluetooth helper library
Other
136 stars 47 forks source link

Build warnings using CocoaPods #88

Closed drdaz closed 5 years ago

drdaz commented 6 years ago

I recently upgraded my xcodeproj gem, which has made building projects using CocoaPods much more... sensitive. I now (and perhaps previously) have the following warnings from RZBluetooth.

Most of it can be fixed by updating the deployment target of RZBluetooth to 7.1 I think.

screen shot 2018-05-17 at 17 44 50

drdaz commented 6 years ago

Alright that was my bad; those warnings were from version 1.0.2.

But the story is similar with the current release. Deploy target needs to be iOS 10 or above now.

drdaz commented 6 years ago

Using #89 I get no more compiler warnings.

KingOfBrian commented 6 years ago

I don't see anything forcing it to be 10.0 and above. What are the warnings for the current release you're seeing? I'd rather not bump to 10+ unless there's a reason.

drdaz commented 6 years ago

screen shot 2018-05-18 at 02 49 32

cpatterson-lilly commented 6 years ago

Ah, yes, we see this build warning as well. It is an incorrect warning, because RZBluetooth has backward-compatibility with the previous CBCentralManagerState and CBPeripheralManagerState enums built-in. I assume Xcode just flags any occurrence of the symbol as a warning.

We silenced this warning in our builds using this code in our Podfile:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == "RZBluetooth.common" || target.name == "RZBluetooth.common-Test" then
        target.build_configurations.each do |config|
            # Silence erroneous RZBluetooth build warnings about `CBManagerState` partial availability
            config.build_settings['CLANG_WARN_UNGUARDED_AVAILABILITY'] = 'NO'
        end
    end
  end
end

Perhaps this build setting could be built-in to the RZBluetooth project, or the equivalent pragma could wrap each occurrence...

KingOfBrian commented 5 years ago

Should be addressed in #95