Skip to content

Commit 65b0b46

Browse files
committed
Added simple swiftpm package file with module map and empty C file to trick the compiler to build the empty C target.
1 parent e34601f commit 65b0b46

File tree

3 files changed

+59
-0
lines changed

3 files changed

+59
-0
lines changed

Package.swift

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// swift-tools-version:5.2
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "cglm",
7+
products: [
8+
.library(name: "cglm", type: .static, targets: ["cglmHeader"]),
9+
.library(name: "cglmc", targets: ["cglmCompiled"]),
10+
],
11+
dependencies: [],
12+
targets: [
13+
.target(
14+
name: "cglmCompiled",
15+
path: "./",
16+
exclude: [
17+
"./docs",
18+
"./dummySrcForSwift",
19+
"./include",
20+
"./test",
21+
"./win",
22+
],
23+
sources: [
24+
"./src",
25+
],
26+
publicHeadersPath: "./include"
27+
),
28+
.target(
29+
name: "cglmHeader",
30+
path: "./",
31+
exclude: [
32+
"./docs",
33+
"./include",
34+
"./src",
35+
"./test",
36+
"./win",
37+
],
38+
sources: [
39+
"./dummySrcForSwift",
40+
],
41+
publicHeadersPath: "./include"
42+
),
43+
],
44+
cLanguageStandard: .c11
45+
)

dummySrcForSwift/empty.c

Whitespace-only changes.

include/module.modulemap

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module cglm {
2+
header "cglm/cglm.h"
3+
header "cglm/struct.h"
4+
5+
export *
6+
}
7+
8+
module cglmc {
9+
header "cglm/cglm.h"
10+
header "cglm/struct.h"
11+
header "cglm/call.h"
12+
13+
export *
14+
}

0 commit comments

Comments
 (0)