Skip to content

NMake Makefiles: Distinguish between Visual Studio 2015, 2017 and 2019 (cairomm-1-14 branch)

Chun-wei Fan requested to merge fanc999/cairomm:msvc.ver.1.14 into cairomm-1-14

Hi,

This updates the NMake Makefiles to distinguish between builds done by Visual Studio 2015, 2017 and 2019, as there might exist corner cases where the resulting binaries are not ABI compatible with the ones that are being built with other Visual Studio versions, even when Microsoft tried very hard to make sure that binaries built with these versions are ABI-compatible. We will use the toolset version (as defined by Micrsoft, vc140 for 2015, vc141 for 2017 and vc142 for 2019) in the DLL and .lib filenames to make such a distinction.

This issue was found when updating the libxml++ NMake Makefiles, where when trying to link against a Visual Studio 2015-built glibmm on Visual Studio 2017 or 2019, the link fails, and attempting to run a 2017- or 2019-built libxml++ binary against a Visual Studio 2015-built glibmm will result in the program failing to load due to missing symbols in the glibmm DLL.

If building with the Visual Studio 2015-style DLL and .lib filename (with the vc140 in the filename) is desired on Visual Studio 2017 and 2019 (such as when it is not convenient to re-build the code that is using cairomm), a NMake commandline option is provided to facilitate that, although it is now noted in the README that this is not recommended unless necessary.

For the master branch, since we do already distinguish between 2017 and 2019 builds (2015 is not supported), this update will come later in the form that makes things more consistent with the updates here

With blessings, thank you!

Merge request reports