Swift package question with ObjC++ module

Viewed 21

I am creating Swift package which includes ObjC++ wrapper for C++ library.

I want to know that how to make one module name (as umbrella) which can expose both 1)ObjC++ module with 2)Swift enum(s). I tried to write module.modulemap like this but no success yet.

Would you someone give me any hint on Package.swift + module.modulemap configuration? Thanks in advance.

// module.modulemap
module ABC { // root Swift.package 
    export * // Some Swift based enum, etc.
    export ABCObjC // I want to expose ObjC++ module 
}
module ABCObjC { // Wrapper ObjC++
    umbrella header "ABCObjC/include/ABCObjC.h"
}

// Example swift code which does not work
import ABC
XCTAssertNotNil(ABCClass()) // ObjC class is not in scope

// Example swift code which works
import ABCObjC
XCTAssertNotNil(ABCClass()) // ObjC class is in scope
0 Answers
Related