diff options
| author | Egor <egor.yusov@gmail.com> | 2018-11-03 15:24:24 +0000 |
|---|---|---|
| committer | Egor <egor.yusov@gmail.com> | 2018-11-03 15:24:24 +0000 |
| commit | 43f9f50a82496604f10c61e30786448ed77a1750 (patch) | |
| tree | 9898334b535de4231f25af5906b3c143536af36b /Graphics/GraphicsEngineVulkan | |
| parent | Fixed odd symbol (diff) | |
| download | DiligentCore-43f9f50a82496604f10c61e30786448ed77a1750.tar.gz DiligentCore-43f9f50a82496604f10c61e30786448ed77a1750.zip | |
Fixed linux build issues with RenderDeviceFactoryVk
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
3 files changed, 29 insertions, 14 deletions
diff --git a/Graphics/GraphicsEngineVulkan/interface/RenderDeviceFactoryVk.h b/Graphics/GraphicsEngineVulkan/interface/RenderDeviceFactoryVk.h index 264bf54d..a6d9afb4 100644 --- a/Graphics/GraphicsEngineVulkan/interface/RenderDeviceFactoryVk.h +++ b/Graphics/GraphicsEngineVulkan/interface/RenderDeviceFactoryVk.h @@ -32,8 +32,25 @@ #include "../../GraphicsEngine/interface/DeviceContext.h" #include "../../GraphicsEngine/interface/SwapChain.h" -#if PLATFORM_UNIVERSAL_WINDOWS && defined(ENGINE_DLL) -# include "../../../Common/interface/StringTools.h" +#if PLATFORM_WIN32 + +# define API_QUALIFIER + +#elif PLATFORM_ANDROID || PLATFORM_LINUX || PLATFORM_MACOS || PLATFORM_IOS + +# if ENGINE_DLL +# if BUILDING_DLL + // https://gcc.gnu.org/wiki/Visibility +# define API_QUALIFIER __attribute__((visibility("default"))) +# else +# define API_QUALIFIER __attribute__((visibility("default"))) +# endif +# else +# define API_QUALIFIER +# endif + +#else +# error Unsupported platform #endif namespace Diligent @@ -63,7 +80,7 @@ namespace Diligent }; -#if ENGINE_DLL +#if ENGINE_DLL && PLATFORM_WIN32 typedef IEngineFactoryVk* (*GetEngineFactoryVkType)(); @@ -85,14 +102,7 @@ namespace Diligent #endif LibName += ".dll"; -#if PLATFORM_WIN32 auto hModule = LoadLibraryA(LibName.c_str()); -#elif PLATFORM_UNIVERSAL_WINDOWS - auto hModule = LoadPackagedLibrary(WidenString(LibName).c_str(), 0); -#else -# error Unexpected platform -#endif - if (hModule == NULL) { std::stringstream ss; @@ -101,7 +111,7 @@ namespace Diligent return false; } - GetFactoryFunc = reinterpret_cast<GetEngineFactoryVkType>(GetProcAddress(hModule, "GetEngineFactoryVk")); + GetFactoryFunc = reinterpret_cast<GetEngineFactoryVkType>(GetProcAddress(hModule, "GetEngineFactoryVkInternal")); if (GetFactoryFunc == NULL) { std::stringstream ss; @@ -115,7 +125,12 @@ namespace Diligent } #else - IEngineFactoryVk* GetEngineFactoryVk(); + API_QUALIFIER + inline IEngineFactoryVk* GetEngineFactoryVk() + { + IEngineFactoryVk* GetEngineFactoryVkInternal(); + return GetEngineFactoryVkInternal(); + } #endif diff --git a/Graphics/GraphicsEngineVulkan/src/GraphicsEngineVk.def b/Graphics/GraphicsEngineVulkan/src/GraphicsEngineVk.def index a9ed58f5..c2834d59 100644 --- a/Graphics/GraphicsEngineVulkan/src/GraphicsEngineVk.def +++ b/Graphics/GraphicsEngineVulkan/src/GraphicsEngineVk.def @@ -1,2 +1,2 @@ EXPORTS - GetEngineFactoryVk
\ No newline at end of file + GetEngineFactoryVkInternal
\ No newline at end of file diff --git a/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp b/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp index c60d9400..ef78f426 100644 --- a/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp +++ b/Graphics/GraphicsEngineVulkan/src/RenderDeviceFactoryVk.cpp @@ -375,7 +375,7 @@ void LoadGraphicsEngineVk(GetEngineFactoryVkType &GetFactoryFunc) #endif -IEngineFactoryVk* GetEngineFactoryVk() +IEngineFactoryVk* GetEngineFactoryVkInternal() { return EngineFactoryVkImpl::GetInstance(); } |
