diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-01-21 19:00:34 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-01-21 19:00:34 +0000 |
| commit | 05d3fe3118549e9d3230a283afcf0c744c23d88a (patch) | |
| tree | 3580a51a5a1d1e1f1815c5798a092e3a18470d49 /Graphics/GraphicsEngineVulkan | |
| parent | Updated zip command in travis script (diff) | |
| download | DiligentCore-05d3fe3118549e9d3230a283afcf0c744c23d88a.tar.gz DiligentCore-05d3fe3118549e9d3230a283afcf0c744c23d88a.zip | |
Fixed shared libaries on linux/mac/iOS
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/CMakeLists.txt | 8 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/interface/RenderDeviceFactoryVk.h | 55 |
2 files changed, 34 insertions, 29 deletions
diff --git a/Graphics/GraphicsEngineVulkan/CMakeLists.txt b/Graphics/GraphicsEngineVulkan/CMakeLists.txt index 40f4a22d..767b20d3 100644 --- a/Graphics/GraphicsEngineVulkan/CMakeLists.txt +++ b/Graphics/GraphicsEngineVulkan/CMakeLists.txt @@ -190,11 +190,13 @@ set(PUBLIC_DEPENDENCIES ) target_link_libraries(GraphicsEngineVk-static PRIVATE ${PRIVATE_DEPENDENCIES} PUBLIC ${PUBLIC_DEPENDENCIES}) -target_link_libraries(GraphicsEngineVk-shared PUBLIC GraphicsEngineVk-static) +target_link_libraries(GraphicsEngineVk-shared PRIVATE BuildSettings PUBLIC ${PUBLIC_DEPENDENCIES}) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") - set_target_properties(GraphicsEngineVk-shared PROPERTIES CXX_VISIBILITY_PRESET hidden) # -fvisibility=hidden + target_link_libraries(GraphicsEngineVk-shared PRIVATE -Wl,--whole-archive GraphicsEngineVk-static -Wl,--no-whole-archive) +else() + target_link_libraries(GraphicsEngineVk-shared PRIVATE GraphicsEngineVk-static) endif() if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") @@ -221,8 +223,8 @@ if (${DILIGENT_NO_GLSLANG}) message("GLSLang is not being built. Vulkan backend will only be able to consume SPIRV byte code.") endif() -target_compile_definitions(GraphicsEngineVk-shared PRIVATE ${PRIVATE_COMPILE_DEFINITIONS} ENGINE_DLL=1) target_compile_definitions(GraphicsEngineVk-static PRIVATE ${PRIVATE_COMPILE_DEFINITIONS} NO_GLSLANG=$<BOOL:${DILIGENT_NO_GLSLANG}>) +target_compile_definitions(GraphicsEngineVk-shared PRIVATE ${PRIVATE_COMPILE_DEFINITIONS} ENGINE_DLL=1) if(PLATFORM_WIN32) diff --git a/Graphics/GraphicsEngineVulkan/interface/RenderDeviceFactoryVk.h b/Graphics/GraphicsEngineVulkan/interface/RenderDeviceFactoryVk.h index add261d3..b5de2664 100644 --- a/Graphics/GraphicsEngineVulkan/interface/RenderDeviceFactoryVk.h +++ b/Graphics/GraphicsEngineVulkan/interface/RenderDeviceFactoryVk.h @@ -48,31 +48,33 @@ namespace Diligent { - class IEngineFactoryVk - { - public: - virtual void CreateDeviceAndContextsVk(const EngineVkAttribs& CreationAttribs, - IRenderDevice **ppDevice, - IDeviceContext **ppContexts, - Uint32 NumDeferredContexts) = 0; +class IEngineFactoryVk +{ +public: + virtual void CreateDeviceAndContextsVk(const EngineVkAttribs& CreationAttribs, + IRenderDevice **ppDevice, + IDeviceContext **ppContexts, + Uint32 NumDeferredContexts) = 0; - //virtual void AttachToVulkanDevice(void *pVkNativeDevice, - // class ICommandQueueVk *pCommandQueue, - // const EngineVkAttribs& EngineAttribs, - // IRenderDevice **ppDevice, - // IDeviceContext **ppContexts, - // Uint32 NumDeferredContexts) = 0; + //virtual void AttachToVulkanDevice(void *pVkNativeDevice, + // class ICommandQueueVk *pCommandQueue, + // const EngineVkAttribs& EngineAttribs, + // IRenderDevice **ppDevice, + // IDeviceContext **ppContexts, + // Uint32 NumDeferredContexts) = 0; - virtual void CreateSwapChainVk(IRenderDevice *pDevice, - IDeviceContext *pImmediateContext, - const SwapChainDesc& SwapChainDesc, - void* pNativeWndHandle, - ISwapChain **ppSwapChain) = 0; + virtual void CreateSwapChainVk(IRenderDevice *pDevice, + IDeviceContext *pImmediateContext, + const SwapChainDesc& SwapChainDesc, + void* pNativeWndHandle, + ISwapChain **ppSwapChain) = 0; - }; +}; -#if ENGINE_DLL && PLATFORM_WIN32 +#if ENGINE_DLL && PLATFORM_WIN32 && defined(_MSC_VER) + +# define EXPLICITLY_LOAD_ENGINE_VK_DLL 1 typedef IEngineFactoryVk* (*GetEngineFactoryVkType)(); @@ -81,17 +83,17 @@ namespace Diligent GetFactoryFunc = nullptr; std::string LibName = "GraphicsEngineVk_"; -#if _WIN64 +# if _WIN64 LibName += "64"; -#else +# else LibName += "32"; -#endif +# endif -#ifdef _DEBUG +# ifdef _DEBUG LibName += "d"; -#else +# else LibName += "r"; -#endif +# endif LibName += ".dll"; auto hModule = LoadLibraryA(LibName.c_str()); @@ -115,6 +117,7 @@ namespace Diligent return true; } + #else API_QUALIFIER |
