Skip to content

Commit ace3820

Browse files
committed
runtime/ldc-build-runtime: Support PHOBOS_SYSTEM_ZLIB
Signed-off-by: Andrei Horodniceanu <[email protected]>
1 parent 71ec765 commit ace3820

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

runtime/ldc-build-runtime.d.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ struct Config {
2020
string[] cFlags;
2121
string[] linkerFlags;
2222
uint numBuildJobs;
23+
bool systemZlib;
2324
string[string] cmakeVars;
2425
}
2526

@@ -160,6 +161,7 @@ void runCMake() {
160161
if (config.dFlags.length) args ~= "-DD_EXTRA_FLAGS=" ~ config.dFlags.join(";");
161162
if (config.cFlags.length) args ~= "-DRT_CFLAGS=" ~ config.cFlags.join(" ");
162163
if (config.linkerFlags.length) args ~= "-DLD_FLAGS=" ~ config.linkerFlags.join(" ");
164+
if (config.systemZlib) args ~= "-DPHOBOS_SYSTEM_ZLIB=ON";
163165

164166
foreach (pair; config.cmakeVars.byPair)
165167
args ~= "-D" ~ pair[0] ~ '=' ~ pair[1];
@@ -324,7 +326,8 @@ void parseCommandLine(string[] args) {
324326
"dFlags", "Extra LDC flags for the D modules (separated by ';')", &config.dFlags,
325327
"cFlags", "Extra C/ASM compiler flags for the handful of C/ASM files (separated by ';')", &config.cFlags,
326328
"linkerFlags", "Extra C linker flags for shared libraries and testrunner executables (separated by ';')", &config.linkerFlags,
327-
"j", "Number of parallel build jobs", &config.numBuildJobs
329+
"j", "Number of parallel build jobs", &config.numBuildJobs,
330+
"systemZlib", "Use system zlib instead of Phobos' vendored version", &config.systemZlib,
328331
);
329332

330333
// getopt() has removed all consumed args from `args`

0 commit comments

Comments
 (0)