[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
Tue May 19 08:07:40 PDT 2020
sebmarchand updated this revision to Diff 264908.
sebmarchand added a comment.
Address Nico's comments.
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,13 @@
+declare_args() {
+ # 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 = ""
+ }
+}
+
declare_args() {
# Whether to include code that links against zlib.
- llvm_enable_zlib = host_os != "win"
+ llvm_enable_zlib = host_os != "win" || 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.264908.patch
Type: text/x-patch
Size: 1144 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200519/e0fcae29/attachment.bin>
More information about the llvm-commits
mailing list