diff options
Diffstat (limited to 'host')
-rw-r--r-- | host/include/uhd/config.h | 14 | ||||
-rw-r--r-- | host/include/uhd/config.hpp | 13 | ||||
-rw-r--r-- | host/lib/CMakeLists.txt | 1 |
3 files changed, 20 insertions, 8 deletions
diff --git a/host/include/uhd/config.h b/host/include/uhd/config.h index 2cb399778..1aab06526 100644 --- a/host/include/uhd/config.h +++ b/host/include/uhd/config.h @@ -57,11 +57,17 @@ typedef ptrdiff_t ssize_t; #endif // API declaration macro -#ifdef UHD_DLL_EXPORTS - #define UHD_API UHD_EXPORT + +// Define API declaration macro +#ifdef UHD_STATIC_LIB + #define UHD_API #else - #define UHD_API UHD_IMPORT -#endif // UHD_DLL_EXPORTS + #ifdef UHD_DLL_EXPORTS + #define UHD_API UHD_EXPORT + #else + #define UHD_API UHD_IMPORT + #endif // UHD_DLL_EXPORTS +#endif // UHD_STATIC_LIB // Platform defines for conditional code: // Taken from boost/config/select_platform_config.hpp, diff --git a/host/include/uhd/config.hpp b/host/include/uhd/config.hpp index 4db905b67..0f619c94a 100644 --- a/host/include/uhd/config.hpp +++ b/host/include/uhd/config.hpp @@ -82,11 +82,16 @@ typedef ptrdiff_t ssize_t; #endif // Define API declaration macro -#ifdef UHD_DLL_EXPORTS - #define UHD_API UHD_EXPORT +#ifdef UHD_STATIC_LIB + #define UHD_API #else - #define UHD_API UHD_IMPORT -#endif // UHD_DLL_EXPORTS + #ifdef UHD_DLL_EXPORTS + #define UHD_API UHD_EXPORT + #else + #define UHD_API UHD_IMPORT + #endif // UHD_DLL_EXPORTS +#endif // UHD_STATIC_LIB + #ifdef UHD_RFNOC_ENABLED #define UHD_RFNOC_API UHD_API #else diff --git a/host/lib/CMakeLists.txt b/host/lib/CMakeLists.txt index cbc022533..4461612de 100644 --- a/host/lib/CMakeLists.txt +++ b/host/lib/CMakeLists.txt @@ -198,6 +198,7 @@ ENDIF(NOT UHDHOST_PKG) IF(ENABLE_STATIC_LIBS) ADD_LIBRARY(uhd_static STATIC ${libuhd_sources}) SET_TARGET_PROPERTIES(uhd_static PROPERTIES OUTPUT_NAME uhd) + SET_TARGET_PROPERTIES(uhd_static PROPERTIES COMPILE_DEFINITIONS UHD_STATIC_LIB) INSTALL(TARGETS uhd_static ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib or .a file ) |