[PATCH] D80042: [gn build] Add a flag to provide the path to zlib on Windows.

Sébastien Marchand via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 15 15:47:12 PDT 2020


sebmarchand updated this revision to Diff 264372.
sebmarchand edited the summary of this revision.
sebmarchand set the repository for this revision to rG LLVM Github Monorepo.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80042/new/

https://reviews.llvm.org/D80042

Files:
  llvm/utils/gn/build/libs/zlib/BUILD.gn
  llvm/utils/gn/build/libs/zlib/enable.gni


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 = ""
+  }
 }
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") {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80042.264372.patch
Type: text/x-patch
Size: 1065 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200515/cb0b4844/attachment-0001.bin>


More information about the llvm-commits mailing list