linker errors - inflate already defined (assimp + freetype)

Hi there,
I’m in the process of converting the following project from visual studio’s build system over to cmake: GitHub - rystills/RaiderEngine at switchToCmake
The project relies on the following external dependencies:
-glad
-glfw
-glm
-OpenAL
-assimp
-freetype
-PhysX
To facilitate the build, I introduced a CMakeLists.txt at the root level (specifying the project name, build flags, and directories), a CMakeLists.txt in the source directory (specifying the source files and libraries to link), and a CMakeLists.txt in each dependency root (specifying that dependency’s build settings and additional includes).
The transition to cmake was successful, with one exception: the linker complains that a number of methods named some variant of “inflate” are already defined (ex. Error | LNK2005 | inflate already defined in freetype.lib(ftgzip.c.obj) | …/x64-Release/RaiderEngine | …/x64-Release/RaiderEngine/zlibstatic.lib(inflate.c.obj)).
As far as I can tell both assimp and freetype rely on zlib, and these errors only manifest when both libraries are linked, but I have no idea how to resolve them. I tried enabling the BUILD_SHARED_LIBS flag to no effect, and I can’t seem to find any similar issues online to refer to. I’m hoping that someone here may be able to shed some light on this issue for me. Any help will be greatly appreciated.

It looks like freetype embeds zlib on Windows without mangling. You’ll probably need to convince it to use the same zlib as everything else is using.

Thank you for the advice; your suggestion put me on the right path. I ultimately realized that I had mistakenly enabled the BUILD_SHARED_LIBS flag for the wrong configuration. Applying the flag to my current configuration enabled freetype and assimp to compile and link without issue, so I won’t be investigating the issue further at this time.