1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[gn build] Put HAVE_LIBZ and HAVE_ZLIB_H behind llvm_enable_zlib too.

In the CMake build, the HAVE_ vars are set based on system inspection,
and LLVM_ENABLE_ZLIB is set to false if neither's found. The GN build
doesn't do autodetection like this.

With this change, people can set llvm_enable_zlib=true on Windows
and as long as they provide a zlib.lib things should actually work.

(https://reviews.llvm.org/D79219 will remove 2 of the 3 config.h
values, hopefully soon. This change here just makes things a tiny
bit easier until that change is in.)
This commit is contained in:
Nico Weber 2020-05-15 16:15:40 -04:00
parent 29a9b23aaf
commit 7b857d8924

View File

@ -202,7 +202,6 @@ write_cmake_config("config") {
"HAVE_ISATTY=",
"HAVE_LIBPTHREAD=",
"HAVE_PTHREAD_SETNAME_NP=",
"HAVE_LIBZ=",
"HAVE_PREAD=",
"HAVE_PTHREAD_GETSPECIFIC=",
"HAVE_PTHREAD_H=",
@ -221,7 +220,6 @@ write_cmake_config("config") {
"HAVE_SYS_TIME_H=",
"HAVE_TERMIOS_H=",
"HAVE_UNISTD_H=",
"HAVE_ZLIB_H=",
"HAVE__CHSIZE_S=1",
"HAVE__UNWIND_BACKTRACE=",
"stricmp=_stricmp",
@ -240,7 +238,6 @@ write_cmake_config("config") {
"HAVE_ISATTY=1",
"HAVE_LIBPTHREAD=1",
"HAVE_PTHREAD_SETNAME_NP=1",
"HAVE_LIBZ=1",
"HAVE_PREAD=1",
"HAVE_PTHREAD_GETSPECIFIC=1",
"HAVE_PTHREAD_H=1",
@ -259,7 +256,6 @@ write_cmake_config("config") {
"HAVE_SYS_TIME_H=1",
"HAVE_TERMIOS_H=1",
"HAVE_UNISTD_H=1",
"HAVE_ZLIB_H=1",
"HAVE__CHSIZE_S=",
"HAVE__UNWIND_BACKTRACE=1",
"stricmp=",
@ -299,10 +295,20 @@ write_cmake_config("config") {
values += [ "LLVM_ENABLE_DIA_SDK=" ]
}
# FIXME: Once https://reviews.llvm.org/D79219 is in, remove the two
# redundant HAVE_ variables.
if (llvm_enable_zlib) {
values += [ "LLVM_ENABLE_ZLIB=1" ]
values += [
"HAVE_LIBZ=1",
"HAVE_ZLIB_H=1",
"LLVM_ENABLE_ZLIB=1",
]
} else {
values += [ "LLVM_ENABLE_ZLIB=" ]
values += [
"HAVE_LIBZ=",
"HAVE_ZLIB_H=",
"LLVM_ENABLE_ZLIB=",
]
}
if (llvm_enable_libxml2) {