magicalpanda / MagicalRecord

Super Awesome Easy Fetching for Core Data!
Other
10.8k stars 1.79k forks source link

get warnings in build with cocoalumberjack #1125

Closed ainame closed 8 years ago

ainame commented 8 years ago

We tried to install MagicalRecord(v2.3.0) and CocoaLumberjack(v2.2.0) via Carthage(v0.9.4).

Cartfile

github "CocoaLumberjack/CocoaLumberjack" "2.2.0"
github "magicalpanda/MagicalRecord" "v2.3.0"

MyApp-Prefix.pch

@import CocoaLumberJack;
@import MagicalRecord;

And then, we get many warnings like following this in Xcode7.1:

xxxxxx.m:52:9: Ambiguous expansion of macro 'LOG_MAYBE'

That line of code use DDLogXXX macro. I think that our situation will break following condition, and LOG_MAYBE macro conflict CocoaLumberjack's one. https://github.com/magicalpanda/MagicalRecord/blob/master/MagicalRecord/Core/MagicalRecordLogging.h#L25

Can I fix these warnings?

anton-matosov commented 8 years ago

JFYI: There should no no such warnings. It seems that #if __has_include("CocoaLumberjack.h") doesn't see the header. This condition was implemented for the CocoaPods where each pod sees all other includes, but it is not the case for Carthage.

kgrigsby59 commented 8 years ago

This worked for me: In MagicalRecordLogging.h change #if __has_include("CocoaLumberjack.h") to #if __has_include("CocoaLumberjack.h") || __has_include("CocoaLumberjack/CocoaLumberjack.h")

tonyarnold commented 8 years ago

This fix has been merged into master, and released as part of MagicalRecord v2.3.2. Please let me know if the problem persists.