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

36 questions
2
votes
1 answer

Objective-C and Swift interoperability inside framework with module mapping

Context Years ago my company built an Objective-C framework that uses a C library and now we're trying to convert it to Swift. Since we need to use this C++ library, instead of completely eliminating objective-c code from the base we need to…
2
votes
0 answers

Hide Objective C in mixed Swift Cocoapod library

I am developing a Swift Cocoapod library which actually is a wrapper around some Objective C code. My goal is to expose only the Swift part of the library, while making the Objective C as private as possible. However, as the Swift part is a wrapper…
Sarquella
  • 1,129
  • 9
  • 26
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…
Avba
  • 14,822
  • 20
  • 92
  • 192
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,411
  • 3
  • 17
  • 38
2
votes
1 answer

How can I add multiple header files recursively in .modulemap?

for example, this .modulemap works: framework module MySDK { umbrella header "MySDK-umbrella.h" header "inc/header1.h" header "inc/header2.h" header "inc/header3.h" ... export * module * { export * } } but this one does…
ZyusAn
  • 369
  • 1
  • 4
  • 13
1
vote
1 answer

No obj-c interfaces generated for swift classes in mixed Swift Obj-C framework unit tests target

I have a mixed Swift Obj-C framework. Inside framework target there is a modulemap file with next contents: framework module ObjCSwiftMix { umbrella "." export * } I also have couple of files: A) Obj-C protocol B) Obj-C class C) Swift…
asevko
  • 46
  • 4
1
vote
1 answer

I added Objective-C files to Swift package via modulemap file, but implementation wasn't connected

I have a Swift package, and try to add Objective-c files. My package now: Root - Package.swift + Sources + ObjC + DataDeflate - DataDeflate.h - module.modulemap - NSData+Deflate.h - NSData+Deflate.m + Swift +…
General Failure
  • 2,421
  • 4
  • 23
  • 49
1
vote
0 answers

Access ObjC/C++ classes in Swift static library

I'm building this Swift static library: OxfordLibrary that I ultimately want to distribute using XCFramework. I have some ObjC/C++ code that want to access from Swift. Since We can't use ObjC bridging header in Static libraries (Throws errors when…
ImShrey
  • 380
  • 4
  • 12
1
vote
1 answer

how to give relative header path inside module map for iOS framework

I'm trying to embed AdswizzSDK into my swift framework. The modulemap header works when I give the absolute path. When I try to give the relative path, it throws the error header file not found. //This works module AdswizzSDK { header…
Teja Nandamuri
  • 11,045
  • 6
  • 57
  • 109
1
vote
0 answers

Swift modulemap tree structure resolution

I want to create a modulemap for a Swift iOS framework. It will be a wrapper around a c library. The problem is that the c library includes a file that is inside of another directory. For example "lib.h" has a following line #include…
1
vote
0 answers

Wrap a c library in a swift framework for iOS development

I have crosscompiled c library for iOS on Linux with clang. Now I want to create a re-usable framework for Swift proejects. What I have is the dylib and the C-Header. But I'm not sure how to start from here. Most tutorials that I found were pretty…
tzippy
  • 6,458
  • 30
  • 82
  • 151
1
vote
0 answers

Swift Compiler Error: 'Files.h' file not found

I've got an Xcode project with the following file structure: MyPlugin.xcodeproject sdk.xcconfig MyPlugin.c MyPlugin.swift MyPlugin-Bridging-Header.h If I remove MyPlugin.swift from the target, everything compiles fine. Adding it to…
Doug
  • 2,972
  • 3
  • 22
  • 28
1
vote
1 answer

Missing required module in iOS framework

trying to make a Swift framework which uses umbrella header to use some c code. But while importing it in the sample app, it shows the warning of missing required module. I know it is directing the path of the module.modulemap file to the framework…
Himanshu Singla
  • 261
  • 3
  • 12
1
vote
0 answers

SwiftPM: How to setup Swift module.map referring to two connected C libraries

I'm trying to build a Swift Package Manager system package (a module.modulemap) making available two system C libraries where one includes the other. That is, one (say libcurl) is a base module and the other C library is including that (like so:…
hnh
  • 13,957
  • 6
  • 30
  • 40
1
vote
1 answer

Getting error "Cannot load underlying module" when importing Swift framework

I have written a framework in Swift 2.3 that uses Cocoapods to utilize a few Objective-C projects such as AFNetworking and CocoaLumberjack. Since bridging headers cannot be used in frameworks I have defined module maps for each Objective-C project…
sigrem
  • 57
  • 1
  • 5