Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support windows linking with xrt_coreutil_static without dllimport #8586

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/runtime_src/core/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
//------------------Enable dynamic linking on windows-------------------------//

#ifdef _WIN32
# ifdef XRT_CORE_COMMON_SOURCE
# define XRT_CORE_COMMON_EXPORT __declspec(dllexport)
# else
# define XRT_CORE_COMMON_EXPORT __declspec(dllimport)
# ifndef XRT_STATIC_BUILD
# ifdef XRT_CORE_COMMON_SOURCE
# define XRT_CORE_COMMON_EXPORT __declspec(dllexport)
# else
# define XRT_CORE_COMMON_EXPORT __declspec(dllimport)
# endif
# endif
#endif
#ifdef __linux__
Expand Down
24 changes: 16 additions & 8 deletions src/runtime_src/core/include/deprecated/xrt.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,23 @@
#endif

#if defined(_WIN32)
#ifdef XCL_DRIVER_DLL_EXPORT
#define XCL_DRIVER_DLLESPEC __declspec(dllexport)
#else
#define XCL_DRIVER_DLLESPEC __declspec(dllimport)
# ifndef XRT_STATIC_BUILD
# ifdef XCL_DRIVER_DLL_EXPORT
# define XCL_DRIVER_DLLESPEC __declspec(dllexport)
# else
# define XCL_DRIVER_DLLESPEC __declspec(dllimport)
# endif
# endif
# define XCL_DRIVER_DLLHIDDEN
#endif
#define XCL_DRIVER_DLLHIDDEN
#else
#define XCL_DRIVER_DLLESPEC __attribute__((visibility("default")))
#define XCL_DRIVER_DLLHIDDEN __attribute__((visibility("hidden")))

#ifdef __linux__
# define XCL_DRIVER_DLLESPEC __attribute__((visibility("default")))
# define XCL_DRIVER_DLLHIDDEN __attribute__((visibility("hidden")))
#endif

#ifndef XCL_DRIVER_DLLESPEC
# define XCL_DRIVER_DLLESPEC
#endif

#ifdef __cplusplus
Expand Down
10 changes: 6 additions & 4 deletions src/runtime_src/core/include/xrt/detail/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
//------------------Enable dynamic linking on windows-------------------------//

#ifdef _WIN32
# ifdef XRT_API_SOURCE
# define XRT_API_EXPORT __declspec(dllexport)
# else
# define XRT_API_EXPORT __declspec(dllimport)
# ifndef XRT_STATIC_BUILD
# ifdef XRT_API_SOURCE
# define XRT_API_EXPORT __declspec(dllexport)
# else
# define XRT_API_EXPORT __declspec(dllimport)
# endif
# endif
#endif
#ifdef __linux__
Expand Down
46 changes: 24 additions & 22 deletions src/runtime_src/xdp/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,41 +22,43 @@
//------------------Enable dynamic linking on windows-----------------------//

#ifdef _WIN32
#ifdef XDP_CORE_SOURCE
#define XDP_CORE_EXPORT __declspec(dllexport)
#else
#define XDP_CORE_EXPORT __declspec(dllimport)
#endif
# ifdef XDP_CORE_SOURCE
# define XDP_CORE_EXPORT __declspec(dllexport)
# else
# define XDP_CORE_EXPORT __declspec(dllimport)
# endif
#endif

#ifdef __linux__
#ifdef XDP_CORE_SOURCE
#define XDP_CORE_EXPORT __attribute__ ((visibility("default")))
#else
#define XDP_CORE_EXPORT
#endif
# ifdef XDP_CORE_SOURCE
# define XDP_CORE_EXPORT __attribute__ ((visibility("default")))
# else
# define XDP_CORE_EXPORT
# endif
#endif

#ifndef XDP_CORE_EXPORT
#define XDP_CORE_EXPORT
# define XDP_CORE_EXPORT
#endif

#ifdef _WIN32
#ifdef XDP_PLUGIN_SOURCE
#define XDP_PLUGIN_EXPORT __declspec(dllexport)
#else
#define XDP_PLUGIN_EXPORT __declspec(dllimport)
#endif
# ifdef XDP_PLUGIN_SOURCE
# define XDP_PLUGIN_EXPORT __declspec(dllexport)
# else
# define XDP_PLUGIN_EXPORT __declspec(dllimport)
# endif
#endif

#ifdef __linux__
#ifdef XDP_PLUGIN_SOURCE
#define XDP_PLUGIN_EXPORT __attribute__ ((visibility("default")))
#else
#define XDP_PLUGIN_EXPORT
#endif
# ifdef XDP_PLUGIN_SOURCE
# define XDP_PLUGIN_EXPORT __attribute__ ((visibility("default")))
# else
# define XDP_PLUGIN_EXPORT
# endif
#endif

#ifndef XDP_PLUGIN_EXPORT
#define XDP_PLUGIN_EXPORT
# define XDP_PLUGIN_EXPORT
#endif

#endif
Loading