Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ModuleMap path resolution

Tags:

xcode

swift

I created my own wrapper around a dylib. I then created a header file to export symbols from this library. I run into the situation where this header is in the wrapper and modulemap can't 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 in the SDK but I really don't want to hard-code the path to my project on my local drive.

I tried prefixing the file name with $(SRCROOT)/MyFramework and other relative options but no luck.

What should I use instead?

like image 869
John Difool Avatar asked Dec 27 '15 06:12

John Difool


1 Answers

In the clang module documentation you find the documentation for Module Maps. Especially there is a framework keyword for Mac OS X frameworks. So you should use

framework module MyFramework [system] {
  header "MyFramework.h"
  export *
} 
like image 125
Marcel Krüger Avatar answered Oct 25 '22 08:10

Marcel Krüger