Skip to content

Use __declspec(dllexport) when building cairomm on Visual Studio (cairomm-1-14)

Chun-wei Fan requested to merge fanc999/cairomm:use-dllexport-1-14 into cairomm-1-14

Hi,

(Please note that this builds on top of MR !2 (merged) and MR !3 (merged))

This updates the headers and build files so that we build cairomm-1-14 on Visual Studio without using gendef, unless explicitly requested, by:

  • Adding a CAIROMM_API annotation for class and function definitions, which on Visual Studio is defined to be __declspec(dllexport) when building cairomm and __declspec(dllimport) when using cairomm by default.

  • For compatibility reasons, since programs using cairomm may need to be rebuilt, add an option BUILD_COMPAT_LIB for the NMake Makefiles, to continue building cairomm with gendef. Note that since the Meson build files build with totally different DLL and library names, we do not provide such options for the Meson build files.

This will help the Visual Studio cairomm builds to function better and be reduced in size, in both the built DLL and the .lib files.

With blessings, thank you!

Edited by Chun-wei Fan

Merge request reports