bjornblissing / osg-3rdparty-cmake

CMake scripts for building OpenSceneGraph third party libraries.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Undefined label names in ZLIB when built with ZLIB_USE_AMD64

aarnchng opened this issue · comments

When building ZLIB with ZLIB_USE_AMD64 being enabled, ZLIB build is unsuccessful due to undefined label names.

I have temporarily solved the issue by doing the following:

ELSEIF(ZLIB_USE_AMD64)
    ... // same as existing
    // adds the following lines
    LIST(APPEND ZLIB_SRCS
        ${ZLIB_SOURCE_DIR}/contrib/masmx64/inffas8664.c)
ENDIF()

Many thanks for your effort in this repository.

Interesting, I have not tried the asm version myself. But my ZLIB CMakeList file is pretty much a verbatim copy of the CMakeList file found inside the ZLIB project. So if my version fails, I guess that the official ZLIB CMakeList file would fail to build as well.

I don't have a AMD cpu so I cannot test your solution. (I only get build errors when trying to build it).

Can you confirm that the above solution works for you? Which compiler are you using?

The above solution works for me when I cmake (with ZLIB_USE_AMD64 being enabled) and build using Visual Studio 2010 64-bit compiler.

Normally I will directly use the Visual Studio Solution provided in the contrib/vstudio folder for building ZLIB. So I check on the Visual Studio Solution and Project Files. Line 604 in Visual Studio Project File (https://github.com/madler/zlib/blob/master/contrib/vstudio/vc10/zlibvc.vcxproj) shows that source file "inffas8664.c" is indeed used for x64 compilation when building with Visual Studio 2010.

And I also take a look at the CMakeList.txt provided in ZLIB github repository (https://github.com/madler/zlib). Indeed it is almost similar and may face the same issue.