Xcode change dynamic framework Product Module Name

956 views Asked by At

I’m trying to change the product module name of a dynamic framework. The main reason I’m doing this is that my framework is customised for each client, so I have different targets with different names and output files that I want to keep different as they are, but I would like the framework to be imported for all the targets with the product name. The framework is in objective C and consumed by a swift application.

In the Xcode build settings the DefinesModule is set to YES.

Let’s say the product name is CustomerSDK and I want it to be imported as ProductSDK. For example: The framework file will be CustomerSDK.framework and the import statement import ProductSDK.

If I use the $(PRODUCT_NAME:c99extidentifier) as the module name (the default option in Xcode) by calling import CustomerSDK it works, but when I try to change the Product Module Name field in build settings to another one the code completion of Xcode in the host application project doesn’t find the module name and even if I write it I get the “No such module ProductSDK” error. Looking inside the resulting product framework I can see that no modulemap file is generated.

I tried also to create a custom module.modulemap file, in this case the code completion of Xcode in the host application project proposes the new name, but when I try to compile I still get the “No such module ProductSDK” error.

framework module ProductSDK {
  umbrella header "CustomerSDK.h"

  export *
  module * { export * }
}
0

There are 0 answers