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
DDTTYLoggeer's AppKit detection doesn't work & Path to CLIColor.h include wrong #488
Comments
Couldn't it be that AppKit is getting added somewhere else in the project? Build steps, |
@rivera-ernesto I'm just compiling one file ( Try it for yourself and just paste this: cat > /tmp/test.m <<EOF
#if __has_include(<AppKit/NSColor.h>)
# error AppKit available
#endif
int main() {
return 0;
}
EOF
xcrun clang -c /tmp/test.m |
I see. What about he included CLI demo? What about something like #ifdef DD_CLI Then people can define As for that path, I think that is because you're not using a project. We could modify as you propose but it may break "regular" projects. Or we can use the same Also |
@rivera-ernesto Sorry for the late reply, I'm proposing PR #497 to fix this issue. Let me know what you think. |
Fix Issue #488: Support DDLog without AppKit Dependency (#define DD_CLI)
Problem: AppKit Dependency
CocoaLumberjack's DDTTYLoggeer is in theory able to work without having
AppKit.framework
linked. It tries to check whether AppKit is linked by using#elif __has_include(<AppKit/NSColor.h>)
. Unfortunately this doesn't work, Apple's clang seems to always find the AppKit includes even if it's using AppKit (verified using Xcode 6.1 and Xcode 6.3 beta 4's clang versions).The following demo program
compiled as
does say the AppKit header files are available but there's no
-framework AppKit
or anything else passed on clang's command line.Therefore, I think CocoaLumberjack's
#elif __has_include(<AppKit/NSColor.h>)
will always betrue
on OS X and which leads to the#else
case (whereCLIColor.h
is included) to never be used. That creates a dependency on AppKit in DDLog.Problem: Path to
CLIColor.h
Additionally the code to use the CLIColor version is
but the
#import
toCLIColor.h
should really beCLI/CLIColor.h
otherwise it won't find CLIColor.h.Possible Solution
DD_NO_APPKIT
orDD_USE_CLICOLOR
or similar that DDTTYLogger would be compiled with CLIColor instead of NSColor to remove the AppKit dependencyThe text was updated successfully, but these errors were encountered: