File tree Expand file tree Collapse file tree 6 files changed +21
-14
lines changed Expand file tree Collapse file tree 6 files changed +21
-14
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,6 @@ runs:
144
144
--installWithSuffix "" \
145
145
CMAKE_INSTALL_PREFIX="$PWD/install" \
146
146
INCLUDE_INSTALL_DIR="$PWD/install/import" \
147
- CONF_INST_DIR="$PWD/install/etc" \
148
147
"${flags[@]}"
149
148
150
149
- name : Cross-compile LDC executables
Original file line number Diff line number Diff line change 24
24
bootstrap-ldc/bin/ldc-build-runtime --ninja \
25
25
--dFlags="-mtriple=$triple" \
26
26
--ldcSrcDir="$PWD/ldc" \
27
- --installWithSuffix="-$arch" \
27
+ --installWithSuffix="-android- $arch" \
28
28
CMAKE_INSTALL_PREFIX="$PWD/installed" \
29
29
"${flags[@]}" \
30
30
ANDROID_ABI="$abi" # override the one in CROSS_CMAKE_FLAGS
31
+
32
+ # patch triple regex in .conf file
33
+ sed -i "s|default:|\"$arch-.*-linux-android\":|" installed/etc/ldc2.conf/55-target-android-$arch.conf
34
+ cat installed/etc/ldc2.conf/55-target-android-$arch.conf
Original file line number Diff line number Diff line change 32
32
CMAKE_OSX_DEPLOYMENT_TARGET="$deployment_target" \
33
33
BUILD_LTO_LIBS=ON
34
34
35
+ # overwrite the generated .conf file (need to patch triple regex and append cross-compile flags)
35
36
cat > installed/etc/ldc2.conf/55-target-ios-$arch.conf <<EOF
36
37
"${arch}-apple-ios":
37
38
{
Original file line number Diff line number Diff line change @@ -79,20 +79,13 @@ runs:
79
79
ldc2-multilib\bin\ldc-build-runtime --ninja ^
80
80
--dFlags=-mtriple=aarch64-windows-msvc ^
81
81
"--ldcSrcDir=%CD%" ^
82
- --installWithSuffix=arm64 ^
82
+ --installWithSuffix=-windows- arm64 ^
83
83
BUILD_LTO_LIBS=ON
84
- - name : Add arm64 section to ldc2 .conf
84
+ - name : Patch triple regex in arm64 .conf file
85
85
shell : pwsh
86
86
run : |
87
87
cd ldc2-multilib
88
- $conf = '"(aarch|arm)64-.*-windows-msvc":
89
- {
90
- lib-dirs = [
91
- "%%ldcbinarypath%%/../libarm64",
92
- ];
93
- };
94
- '
95
- Set-Content etc\ldc2.conf\55-target-windows-arm64.conf $conf
88
+ (cat etc\ldc2.conf\55-target-windows-arm64.conf).replace('default:', '"(aarch|arm)64-.*-windows-msvc":') | Set-Content etc\ldc2.conf\55-target-windows-arm64.conf
96
89
cat etc\ldc2.conf\*
97
90
- name : Run arm64 hello-world cross-compilation smoke tests
98
91
shell : cmd
Original file line number Diff line number Diff line change @@ -280,7 +280,18 @@ if(SHARED_LIBS_SUPPORTED)
280
280
set (install_rpath "${install_libdir} " )
281
281
endif ()
282
282
283
- makeConfSection (NAME "50-target-default"
283
+ # LIB_SUFFIX is (ab)used by ldc-build-runtime and set to the optional `--installWithSuffix`.
284
+ # If set and non-empty, change the name of the generated .conf file.
285
+ set (conf_base_name "50-target-default" )
286
+ if (NOT "${LIB_SUFFIX} " STREQUAL "" )
287
+ if (LIB_SUFFIX MATCHES "^-" )
288
+ set (conf_base_name "55-target${LIB_SUFFIX} " )
289
+ else ()
290
+ set (conf_base_name "55-target-${LIB_SUFFIX} " )
291
+ endif ()
292
+ endif ()
293
+
294
+ makeConfSection (NAME "${conf_base_name} .conf"
284
295
SECTION "default"
285
296
286
297
BUILD
Original file line number Diff line number Diff line change @@ -170,7 +170,6 @@ void runCMake() {
170
170
args ~= [
171
171
"-DCMAKE_INSTALL_PREFIX=" ~ config.ldcExecutable.dirName.dirName,
172
172
"-DLIB_SUFFIX=" ~ config.installWithSuffix,
173
- "-DCONF_INST_DIR=", // don't install/overwrite existing etc/ldc2.conf!
174
173
];
175
174
}
176
175
You can’t perform that action at this time.
0 commit comments