cmake: fix windows build when building with static libraries

On Windows, __declspec(dllimport) changes the name of the symbol to what
would be provided by the .lib accompanying the .dll.  When generating a
static library, the .lib provides the original name, resulting in undefined
symbols during linking.

On Linux and MacOS, __attribute__((visibility ("default"))) changes the
visibility of the symbol and would cause it to be exported from any library
linking against libipt.a.  That's not necessarily the desired behaviour.

When using static libraries, we don't really need to export/import anything.

Change-Id: Ia4dab6d43feadf9a36446b1f6a3b315dc3826483
Signed-off-by: Markus Metzger <>
3 files changed