ModuleMap path resolution

I created my own wrapper around dylib. Then I created a header file to export characters from this library. I am faced with a situation where this header is in a shell and modulemap cannot find it.

> MyFramework (project directory) > MyFramework.xcconfig MODULEMAP_FILE[sdk=macosx*] = $(SRCROOT)/MyFramework/macosx.modulemap > macosx.modulemap: module MyFramework [system] { header "MyFramework.h" // CAN NOT FIND THE FILE export * } > MyFramwork.h (contains a bunch of declarations) 

I found examples with absolute paths pointing to the SDK, but I really don't want to hard code the path to my project on my local drive.

I tried the file name prefix with $ (SRCROOT) / MyFramework and other relative parameters, but no luck.

What should i use instead?

+5
source share
1 answer

In the clang module documentation, you will find documentation for module maps. The framework keyword is especially suitable for Mac OS X frameworks. Therefore, you should use

 framework module MyFramework [system] { header "MyFramework.h" export * } 
+2
source

Source: https://habr.com/ru/post/1239283/


All Articles