@@ -39,77 +39,26 @@ runs:
39
39
rm lib-{x86_64,arm64}/libLTO.dylib
40
40
41
41
# ldc2.conf:
42
- # 1) make a backup copy
43
- cp etc/ldc2.conf /tmp/ldc2.conf.bak
44
- # 2) strip to the header comments (remove all existing sections, only keep `default:` or `"default":` line)
45
- sed -E -i '' '/^"?default"?:$/q' etc/ldc2.conf
46
- # 3) append all sections (except for wasm)
47
- cat >>etc/ldc2.conf <<EOF
48
- {
49
- // default switches injected before all explicit command-line switches
50
- switches = [
51
- "-defaultlib=phobos2-ldc,druntime-ldc",
52
- ];
53
- // default switches appended after all explicit command-line switches
54
- post-switches = [
55
- "-I%%ldcbinarypath%%/../import",
56
- ];
57
- // default directories to be searched for libraries when linking
58
- lib-dirs = [];
59
- // default rpath when linking against the shared default libs
60
- rpath = "";
61
- };
62
42
63
- // macOS:
64
-
65
- "x86_64-apple-":
43
+ # 1) x86_64 ios config
44
+ # already present
45
+ # 2) arm64 ios config
46
+ cp ../ldc2-arm64/etc/ldc2.conf/31-ldc-runtime-lib-ios-arm64.conf etc/ldc2.conf
47
+ # 3) x86_64 & arm64 macos
48
+ rm etc/ldc2.conf/30-ldc-runtime-lib.conf # the old ldc2-x86_64 config
49
+ for arch in x86_64 arm64; do
50
+ cat > etc/ldc2.conf/30-ldc-runtime-lib-${arch}.conf <<EOF
51
+ "${arch}-apple-":
66
52
{
67
53
lib-dirs = [
68
- "%%ldcbinarypath%%/../lib-x86_64 ",
54
+ "%%ldcbinarypath%%/../lib-${arch} ",
69
55
];
70
- rpath = "%%ldcbinarypath%%/../lib-x86_64 ";
56
+ rpath = "%%ldcbinarypath%%/../lib-${arch} ";
71
57
};
72
-
73
- "arm64-apple-":
74
- {
75
- lib-dirs = [
76
- "%%ldcbinarypath%%/../lib-arm64",
77
- ];
78
- rpath = "%%ldcbinarypath%%/../lib-arm64";
79
- };
80
-
81
- // iOS:
82
-
83
- "x86_64-apple-ios":
84
- {
85
- switches ~= [
86
- "-Xcc=-isysroot",
87
- "-Xcc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk",
88
- ];
89
- lib-dirs = [
90
- "%%ldcbinarypath%%/../lib-ios-x86_64",
91
- ];
92
- rpath = "%%ldcbinarypath%%/../lib-ios-x86_64";
93
- };
94
-
95
- "arm64-apple-ios":
96
- {
97
- switches ~= [
98
- "-Xcc=-isysroot",
99
- "-Xcc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk",
100
- ];
101
- lib-dirs = [
102
- "%%ldcbinarypath%%/../lib-ios-arm64",
103
- ];
104
- rpath = "%%ldcbinarypath%%/../lib-ios-arm64";
105
- };
106
-
107
- // WebAssembly
108
58
EOF
109
- # 4) append the wasm section from the backup
110
- sed -n '/^"\^wasm/,$p' /tmp/ldc2.conf.bak | sed '/^\};$/q' >> etc/ldc2.conf
59
+ done
111
60
112
- cat etc/ldc2.conf
61
+ cat etc/ldc2.conf/*
113
62
114
63
- name : Run x86_64/arm64 macOS/iOS cross-compilation smoke tests
115
64
shell : bash
0 commit comments