realm / jazzy

Soulful docs for Swift & Objective-C
https://realm.io
MIT License
7.35k stars 413 forks source link

Objc XCFramework - jazzy failed with error: 'MyModule/Myfile.h' file not found #1343

Closed ferencIOS closed 1 year ago

ferencIOS commented 1 year ago

I have a xcframework and I'm trying to extrapolate the documentation from the various headers.

In my .jazzy.yaml

objc: true
clean: true
sdk: iphonesimulator
module: MyModule
umbrella_header: ./build/MyModule.xcframework/ios-arm64_x86_64-simulator/MyModule.framework/Headers/MyModule.h
framework_root: ./build/MyModule.xcframework/ios-arm64_x86_64-simulator/
output: ./build/documentation/

Reading the documentation:

Problem: Non-SDK include failure
For example fatal error: 'MyModule/SomeHeader.h' file not found.
[...]
If you are happy to build the framework project before generating docs and all the problematic paths have the form ModuleName/PublicHeader.h then have clang resolve those includes to the built framework by passing -F <path of directory containing ModuleName.framework>.
[...]

I'm not understanding what to add and where to add it.

Thanks for your help.

johnfairh commented 1 year ago

If you want to pass flags like -F to clang then you'll need to use the 'direct mode' that lets you pass flags to clang, described at the start of the doc you linked.

Something like (guessing):

--build-tool-arguments
          --objc,./build/..../MyModule.h,--,-x,objective-c,
          -isysroot,$(xcrun (whatever for your sdk)),
          -F,(the directory with the framework),
          -fmodules

I don't know if relative paths work here, might have to expand them.

johnfairh commented 1 year ago

Closing, answered/inactive.