Index: llvm/utils/gn/build/libs/zlib/BUILD.gn =================================================================== --- llvm/utils/gn/build/libs/zlib/BUILD.gn +++ llvm/utils/gn/build/libs/zlib/BUILD.gn @@ -2,7 +2,13 @@ config("zlib_config") { visibility = [ ":zlib" ] - libs = [ "z" ] + if (host_os == "win") { + assert(zlib_path != "", "Please provide the path to zlib") + include_dirs = [ zlib_path ] + libs = [ "$zlib_path/zlib.lib" ] + } else { + libs = [ "z" ] + } } group("zlib") { Index: llvm/utils/gn/build/libs/zlib/enable.gni =================================================================== --- llvm/utils/gn/build/libs/zlib/enable.gni +++ llvm/utils/gn/build/libs/zlib/enable.gni @@ -1,4 +1,11 @@ declare_args() { # Whether to include code that links against zlib. llvm_enable_zlib = host_os != "win" + + # Enabling zlib on Windows requires to provide the path to the .lib and + # its header files. + if (host_os == "win") { + # The path to zlib.lib and its corresponding header files. + zlib_path = "" + } }