maxmind / libmaxminddb

C library for the MaxMind DB file format
https://maxmind.github.io/libmaxminddb/
Apache License 2.0
912 stars 239 forks source link

build: cmake: remove lib prefix on Windows #258

Closed fcelda closed 3 years ago

fcelda commented 3 years ago

CMAKE_SHARED_LIBRARY_PREFIX defaults to lib on UNIX systems but to an empty string on Windows which follows the conventions on these systems. The existing build forces the prefix on all platforms so the dynamic library produced by this setup on Windows will be libmaxminddb.dll (instead of maxminddb.dll).

This patch just removes the explicit configuration of the prefix so the dynamic library on Linux will be libmaxminddb.so and maxminddb.dll on Windows.

I'm not sure if this hard-coded prefix was intentional. I'm working on Conan package for libmaxmminddb and I have to include this patch to make linking work on Windows. It could be something specific to Conan though but I think the change makes sense.