Force zlib dependencies into the shared toolchain

Change-Id: I1c67d07d135a464927517ccc3ee6f22ad6371ee7
diff --git a/BUILD.gn b/BUILD.gn
index 5480898..a8ffb91 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -26,6 +26,7 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+import("//build/toolchain/shared.gni")
 import("//packages/package.gni")
 
 config("zlib_config") {
@@ -38,8 +39,19 @@
   cflags = [ "-Wno-implicit-function-declaration" ]
 }
 
-shared_library("zlib") {
-  output_name = "libz"
+group("zlib") {
+  public_configs = [ ":zlib_config" ]
+
+  public_deps = [
+    ":z_lib($shared_toolchain)",
+  ]
+}
+
+shared_library("z_lib") {
+  visibility = [ ":*" ]
+
+  output_name = "z"
+
   sources = [
     "adler32.c",
     "compress.c",
@@ -85,7 +97,19 @@
   }
 }
 
-shared_library("minizip") {
+group("minizip") {
+  public_configs = [ ":zlib_config" ]
+
+  public_deps = [
+    ":minizip_lib($shared_toolchain)",
+  ]
+}
+
+shared_library("minizip_lib") {
+  visibility = [ ":*" ]
+
+  output_name = "minizip"
+
   sources = [
     "contrib/minizip/crypt.h",
     "contrib/minizip/ioapi.c",