AppCode fails for IOKit Kexts

Right now (as of 3.3 & 3.4RC1), it's a real problem to try to build an IOKit kext with AppCode (even though this is one of the project types available from the main "new project" menu).  The reason seems to be that AppCode code sensing/validation/completion fails for the IOKit library -- and specifically, I think it's because when you "#include <IOKit/...>" then it looks in IOKit.framework instead of it in Kernel.framework/IOKit/ .  So you get a screen full of red, a gutter full of red, but then the build works just fine.

I've got to think this is a simple fix -- either don't assume the first token in the include is a framework name, or else if you don't find the included file in the framework then continue the search like normal assuming it is a directory name in another framework.

Please have a look at this bug because it's very simple but nearly crippling for building this kind of project.

Here's a screenshot where you see all the red in the file, but then a successful build underneath:

With a more complicated source file, it's easy to get the entire right gutter nearly solid red.

Here's a GitHub project with the simple example for you to try it out yourself:

https://github.com/ammulder/KextTest

Thanks!

4
3 comments

To be clear, the files I'm trying to #include are in MacOSX10.11.sdk/System/Library/Frameworks/Kernel.framework/Headers/ (in the screen shot IOKit/IOLib.h and IOKit/pci/IOPCIDevice.h).  As the successful build indicates, Xcode works fine with this.  It seems to work the same whether I've added Kernel.framework to the framework list for the project or not.

1

Well, its still A thing on AppCode 2018.1.

1
Avatar
Permanently deleted user

Same problem in AppCode 2019.1.

0

Please sign in to leave a comment.