Questions tagged [module-map]

For questions about Clang modules and module map syntax.

For questions about Clang modules and module map syntax. Clang modules are documented here

30 questions
9
votes
1 answer

How to use static library and module map file with Swift?

I'm trying to include a 3rd party static library in my Swift project. I have these two files, among a few others. GoogleConversionTrackingSDK/ACTReporter.h GoogleConversionTrackingSDK/libGoogleConversionTracking.a I added the .a file to the…
Rob N
  • 11,371
  • 11
  • 72
  • 126
9
votes
1 answer

Swift Project: "Missing Required Modules" when import a modular framework

Setup I create a swift framework which include C library (CommonCrypto) and a Objective C file. There is no bridge-header in swift project. So I create a module.modulemap to import CommonCrypto and Objective-C file into my swift…
HungCLo
  • 382
  • 1
  • 5
  • 19
7
votes
2 answers

Relative Path for Headers in Modulemap

Currently i am trying to optimize my modulemap. The problem was that i could not add my framework to my project because i used a obj-c Framework in my swift framework. I added the Obc-c headers in my modulemap and made the module work and could…
Offset
  • 529
  • 1
  • 4
  • 20
6
votes
1 answer

Non-modular headers of OpenSSL library when using modulemap for Swift framework

I'm trying to link statically OpenSSL library to my Swift framework, using XCode. Most approaches mentioned online are not correct, because they suggest using Import path (SWIFT_INCLUDE_PATHS). As a result, the framework binary is locked to a…
Lukas1
  • 580
  • 1
  • 6
  • 26
6
votes
0 answers

How to create Swift import submodules

Currently we have modularized our Swift project, using multiple targets. The targets compile to .framework files that are dependencies of the higher targets. We have a Common module target, a few Product module targets, and the original App…
Miro
  • 5,085
  • 1
  • 33
  • 59
6
votes
1 answer

Can I use environment variables or tilde in module.modulemap?

My module.modulemap file looks like this: module CompanyInternalSDK { header "~/Company/CompanyInternalSDK.framework/Headers/CompanyInternalSDK.h" export * } However, I get this…
Ben Leggiero
  • 25,904
  • 38
  • 161
  • 267
4
votes
1 answer

Module map location and compiler settings with mixed Objective-C/Swift frameworks

Background: I'm converting a large old mixed language codebase to a framework. I'm having problems, so I thought I'd start with a minimal test project to see how things work. I ran into more problems. This is Swift 5.0 with Xcode 10.2.1. I created a…
Juri Pakaste
  • 1,367
  • 9
  • 15
4
votes
0 answers

Unable to load module map in Swift Dynamic Framework

I'm working on a Swift dynamic framework which has some Objective-C code in it. I need to use some legacy Objective-C code without exposing the code to it. I came to know that I can use a module map to avoid adding the headers as public in the…
ebby94
  • 2,981
  • 2
  • 20
  • 31
4
votes
0 answers

Is it possible to use system-wide headers in a modulemap?

I want to bind OpenSSL to my Swift client code. What I use now is an umbrella header referenced in a module map: module COpenSSL [system] { header "copenssl.h" export * } That copenssl.h rests in the same directory and it is just a series of…
Zomagk
  • 349
  • 1
  • 10
4
votes
0 answers

Missing Required Modules in Swift framework

I built a swift framework with two Objective-C classes. After I released a framework, it works on my environment. But I imported this to another environment, but it didn't work. "Missing Require Modules..." Here is my module. module RSAUtil [system]…
4
votes
1 answer

#include of a system header from a modularized project header file gives "Include of non-modular header inside framework module..." error

I am trying to embed libarchive in a Swift-based framework I am building. I created a module map to privately include archive.h (inside module libarchive near the end) framework module X { requires objc, blocks, objc_arc umbrella header…
nielsbot
  • 15,547
  • 4
  • 45
  • 71
2
votes
0 answers

Xcode change dynamic framework Product Module Name

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…
Andrea
  • 24,774
  • 10
  • 79
  • 121
2
votes
0 answers

how to wrap cassandra c++ driver in a swift module

I'm trying to write a server side swift application against the cassandra c++ driver (no swift native support as far as I know) I was able to install the cassandra c++ locally on my mac like so: # Datastax C++ driver dependencies brew install…
Avner Barr
  • 13,049
  • 14
  • 82
  • 152
2
votes
1 answer

Are "link framework" lines necessary in a modulemap file?

Some framework files come with a module.modulemap that contain "link framework" lines. For example, here is the current content of Intercom's module.modulemap file: framework module Intercom { umbrella header "Intercom.h" [...] link…
peco
  • 1,192
  • 3
  • 12
  • 34
2
votes
0 answers

How do I use C Module Maps in an Xcode Playground?

I have an Xcode playground and projects in a workspace, so I can import those projects into the playground. This setup works until I try to import a project that uses C module maps. The project itself imports, but I get errors such as error: missing…
Caleb Kleveter
  • 10,260
  • 8
  • 56
  • 79
1
2