[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 264371.
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
+ # 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,9 +2,15 @@
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") {
if (llvm_enable_zlib) {
public_configs = [ ":zlib_config" ]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80042.264371.patch
Type: text/x-patch
Size: 1127 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200515/f6028900/attachment-0001.bin>
More information about the llvm-commits
mailing list