Mads Marquart
Mads Marquart
Clang has ["module maps"](https://clang.llvm.org/docs/Modules.html#module-map-language) for figuring out what to import from Objective-C headers - we should use those!
Currently I'm trying to push forwards on an initial version that actually compiles `Foundation` and `AppKit`. Primary missing items are: - Proper imports - Struct definitions - A few remaining...
I could use some guidance though: I'll admit I'm not the best at `git`, and I'm unsure if storing the generated result in `git` is the best solution? It does...
> I tend to like using a generator crate in a build script Yeah, I'm aware of that approach, my desire with `header-translator`/`icrate` was to do things a bit differently...
Status: `cargo build -picrate --features Foundation` now works! 🎉 A clean build takes ~25 seconds, a build with a single file changed takes ~11 seconds (on my pretty old machine)....
Putting everything in one file does not seem to affect the result in any meaningful way, so doing the imports in a different way also probably won't have any impact.
For comparison, I tried compiling the following: ```toml [dependencies.windows] version = "0.43.0" features = [ "Foundation_Collections", "Foundation_Diagnostics", "Foundation_Metadata", "Foundation_Numerics", "Data_Xml_Dom", "Win32_Foundation", "Win32_Security", "Win32_System_Threading", "Win32_UI_WindowsAndMessaging", ] ``` There, the compiler spent...
Note to self: Swift has a pretty comprehensive test suite for their Objective-C import functionality, maybe we could reuse a few headers from there? https://github.com/apple/swift/blob/7123d2614b5f222d03b3762cb110d27a9dd98e24/test/Inputs/clang-importer-sdk/usr/include/errors.h
Wrt. compilation times: I'm considering adding features such as `Foundation_NSArray` to enable functionality from `Foundation/NSArray.h` (`NSArray`, `NSMutableArray`, and probably all the things that are transitively enabled by this, such as...
`AppKit` now compiles! Clean build 1m 30s, clean check build 52s.