From d3796b65314faafbc3c4167971998c1baf27be2e Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Wed, 31 Mar 2010 14:03:12 +0000 Subject: [PATCH] Attempt to be able to compile using manual makefile AND with CMake --- src/include/nfc/nfc.h | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/include/nfc/nfc.h b/src/include/nfc/nfc.h index d3d7e85..e10e6d1 100644 --- a/src/include/nfc/nfc.h +++ b/src/include/nfc/nfc.h @@ -30,15 +30,22 @@ #include #include -#if defined (_WIN32) - #if defined(nfc_EXPORTS) - #define NFC_EXPORT __declspec(dllexport) - #else - #define NFC_EXPORT __declspec(dllimport) - #endif /* nfc_EXPORTS */ -#else /* defined (_WIN32) */ - #define NFC_EXPORT -#endif +#ifdef _WIN32 + /* Windows platform */ + #ifndef _WINDLL + /* CMake compilation */ + #ifdef nfc_EXPORTS + #define NFC_EXPORT __declspec(dllexport) + #else /* nfc_EXPORTS */ + #define NFC_EXPORT __declspec(dllimport) + #endif /* nfc_EXPORTS */ + #else /* _WINDLL */ + /* Manual makefile */ + #define NFC_EXPORT + #endif /* _WINDLL */ +#else /* _WIN32 */ + #define NFC_EXPORT +#endif /* _WIN32 */ #include