[zlib] CMakeLists.txt: Fixed the 64-bit MSVC build.
authorDavid Korth <gerbilsoft@gerbilsoft.com>
Thu, 3 Sep 2015 01:15:15 +0000 (21:15 -0400)
committerDavid Korth <gerbilsoft@gerbilsoft.com>
Thu, 3 Sep 2015 01:15:15 +0000 (21:15 -0400)
inffas8664.c is required in order to use the asm code. Otherwise,
it fails to link because inflate_fast() is undefined.

extlib/zlib/CMakeLists.txt

index ceca1c6..000381c 100644 (file)
@@ -171,6 +171,10 @@ if(MSVC)
                        contrib/masmx64/gvmat64.asm
                        contrib/masmx64/inffasx64.asm
                )
+               # Gens/GS II: MSVC amd64 also requires inffas8664.c.
+               set(ZLIB_ASM_C_SRCS
+                       contrib/masmx64/inffas8664.c
+                       )
        endif()
 
        if(ZLIB_ASMS)
@@ -201,9 +205,10 @@ if(MINGW)
 endif(MINGW)
 
 # Gens/GS II: Don't build zlib as a shared library.
-#add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
+# Gens/GS II: Added ${ZLIB_ASM_C_SRCS} for 64-bit MSVC builds.
+#add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_ASM_C_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
 add_custom_target(zlib)
-add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
+add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_ASM_C_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
 set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
 set_target_properties(zlib PROPERTIES SOVERSION 1)
 add_definitions(${ZLIB_DEFINITIONS})