@@ -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