mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-04-21 01:58:28 -05:00
24226419ed
The CMakeLists file for the static zlib checks for presence of unistd.h, but it doesn't properly define HAVE_UNISTD_H if it's found. This change adds the necessary preprocessor definition if unistd.h is found. Upstream zlib handles this with by configuring zconf.h with CMake: https://github.com/madler/zlib/blob/cacf7f1d4e3d44d871b605da3b647f07d718623f/zconf.h.cmakein#L11 Dolphin's static version of zlib doesn't do this, which is why setting Z_HAVE_UNISTD_H in zlib's CMakeLists.txt isn't enough. This probably wasn't noticed since because most *nix systems will use the shared zlib. Force use of the static zlib (comment out find_package(ZLIB) in the root CMakeLists.txt) and you'll see implicit function declaration warnings during its compilation.