0

TLDR Question

Why are my changes to Prefix Header being ignored? How do I get my xcode project to acknowledge the Prefix Header a.k.a GCC_PREFIX_HEADER.

Context

I am trying to add a pch file to my framework for ios/osx. I have been following the instructions I've found in other S.O. posts(like this one), but haven't even been able even get the GCC_PREFIX_HEADER/Prefix Header field to give me a compilation error when I type an invalid address.

Steps

enter image description here 1. Select NetworkFramework.xcodeproj in XCode 8.3.2

    • For each of:
      • my project, called NetworkFramework;
      • my targets, called NetworkFrameWorkMobile and NetworkFrameworkMac
    • Set:
      • Build Settings > Apple LLVM 8.1 - Language > Precompile Prefix Header
        • To: YES
      • Build Settings > Apple LLVM 8.1 - Language > Prefix Header
        • To: GIBBERISH (I think this should be invalid input)
  1. Clean the build directory:
    • k
  2. Build
    • b

What I expect

Since I named the prefix header GIBBERISH I expect there to be some sort of build error

What I get

A successful build, with no errors

Other things I have tried

  • Closing and reopening XCode
  • Deleting /Users/topguncoder/Library/Developer/Xcode/DerivedData + restarting xcode + clean build

Reason for wanting a prefix header

I'm trying to get CocoaLumberJack for this project. They recommend having the following in the pch file:

#define LOG_LEVEL_DEF ddLogLevel
#import <CocoaLumberjack/CocoaLumberjack.h>
Community
  • 1
  • 1
CoderDake
  • 1,497
  • 2
  • 15
  • 30

1 Answers1

0

You don't need to use a prefix header in Swift. But if you want you still can, using Objective-C Bridging Header. Read both answers at this thread:

Is there a Prefix Header (or something with this functionality) in Swift?

Community
  • 1
  • 1
Witterquick
  • 6,048
  • 3
  • 26
  • 50