Skip to content

Commit fb0ae60

Browse files
committed
[ios] expose explict module for c & cpp
- standard user can import spine-c based api without c warning - dedicated user can import cpp interface with explict import and enabling cpp interp - objective-c user can not import cpp using objective-c++ without issue
1 parent 7c28c3c commit fb0ae60

File tree

9 files changed

+19
-16
lines changed

9 files changed

+19
-16
lines changed

Package.swift

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,8 @@ let package = Package(
4141
name: "SpineC",
4242
path: "spine-ios/Sources/SpineC",
4343
sources: [
44-
"spine-c/src/extensions.cpp",
45-
"spine-c/src/generated",
46-
"spine-cpp/src/spine"
47-
],
48-
publicHeadersPath: "spine-c/include",
49-
cxxSettings: [
50-
.headerSearchPath("spine-c/include"),
51-
.headerSearchPath("spine-c/src"),
52-
.headerSearchPath("spine-c/src/generated"),
53-
.headerSearchPath("spine-cpp/include"),
54-
.headerSearchPath("spine-cpp/src"),
44+
"src",
45+
"spine"
5546
],
5647
linkerSettings: [
5748
.linkedLibrary("c++")

spine-c/include/module.modulemap

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
module SpineC {
2-
header "spine-c.h"
3-
export *
4-
}
2+
use c
3+
export c
4+
explicit module cpp {
5+
umbrella header "spine/spine.h"
6+
requires cplusplus11
7+
export *
8+
}
9+
explicit module c {
10+
header "spine-c.h"
11+
export *
12+
}
13+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../spine-c/include/module.modulemap
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../spine-cpp/include/spine
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../spine-c/include/spine-c.h

spine-ios/Sources/SpineC/spine

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../spine-cpp/src/spine

spine-ios/Sources/SpineC/spine-c

Lines changed: 0 additions & 1 deletion
This file was deleted.

spine-ios/Sources/SpineC/spine-cpp

Lines changed: 0 additions & 1 deletion
This file was deleted.

spine-ios/Sources/SpineC/src

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../spine-c/src

0 commit comments

Comments
 (0)