Building a D-ISAM framework for Xcode

Note that this post covers the manual process of creating a framework – please refer to Building D-ISAM in the Xcode IDE for the integrated approach.

Before starting please see Update for Constant Chars.

To make a D-ISAM framework you must first create a public directory called (for example) Disam72.framework, and create a symbolic link in this directory named Disam72, which points to your D-ISAM dylib, as installed.

Note that the name of the framework and the name of the dylib pointer are the same. This defines the import name of your framework.

mkdir /Library/Disam72.dylib
cp target/disam72_shared/lib/libdisam72.dylib /Library/Disam72
ln -s /Library/Disam72/libdisam72.dylib /Library/Disam72/Disam72.framework/Disam72

You then need to create a Header directory inside Disam72.framework, containing your disam header files, together with an “umbrella” header to organise them – in this example it is named disam_xcode.h

/* disam umbrella header */
#define ISCONSTCHAR 1"
#import "isbase.h"
#undef ISCONSTCHAR"

And finally, create a file called module.map in Disam72.framework

framework module $DISAM [system] {
  umbrella header "disam_xcode.h"
  export *
}

The above presents a bare minimum of steps needed to create a framework that will import easily into Xcode and Swift.  However it leaves out quite a few details that are probably important, and which are generally included automatically when Building D-ISAM in the Xcode IDE.

The whole process is documented in Guidelines for Creating Frameworks.

Leave a Reply