finally i was able to create an xcode project which allows you to build a static library for kernel projects.
as mentioned in my previous article this is not possible out of the box in xcode. if you create a plain generic kernel extension project and you change in build settings Mach-O type to “Static Library” your project won’t simply compile.
but there is a trick to archive what we want.
- create a plain generic kernel extension project
- close the project ( close xcode )
- change into the project directory and right-click on the project “file” ( yourprojectname.xcodeproj) and select “Show Package Content”
- Suddenly the isn’t a file anymore instead if revealed it true nature as a directory at which you are now looking at
- open “project.pbxproj” file in a text editor
- search for following line: “productType = “com.apple.product-type.kernel-extension”;”
- replace that line with: “productType = “com.apple.product-type.library.static”;”
That is it! Unbelievable….right ? Usually I would expect that the change from “Kernel Extension” to “Static Library” should exactly to that, but obviously such a change cannot be applied within xcode directly.
Anyway, I very happy now ;D I exactly have what i need. A maintainable project WITHIN xcode which allows me to create static libraries for kernel extensions.
mitp0sh of [PDX]