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/GraphicsEngineOpenGL | |
| 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/GraphicsEngineOpenGL')
| -rw-r--r-- | Graphics/GraphicsEngineOpenGL/CMakeLists.txt | 16 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineOpenGL/interface/RenderDeviceFactoryOpenGL.h | 16 |
2 files changed, 18 insertions, 14 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/CMakeLists.txt b/Graphics/GraphicsEngineOpenGL/CMakeLists.txt index 751db277..b2b1c1ee 100644 --- a/Graphics/GraphicsEngineOpenGL/CMakeLists.txt +++ b/Graphics/GraphicsEngineOpenGL/CMakeLists.txt @@ -159,11 +159,11 @@ set(PRIVATE_DEPENDENCIES TargetPlatform GraphicsEngine GLSLTools + HLSL2GLSLConverterLib ) set(PUBLIC_DEPENDENCIES GraphicsEngineOpenGLInterface - HLSL2GLSLConverterLib ) if(PLATFORM_WIN32) @@ -181,11 +181,6 @@ else() message(FATAL_ERROR "Unknown platform") endif() -if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR - CMAKE_CXX_COMPILER_ID MATCHES "GNU") - set_target_properties(GraphicsEngineOpenGL-shared PROPERTIES CXX_VISIBILITY_PRESET hidden) # -fvisibility=hidden -endif() - if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # Disable the following clang warning # '<function name>' hides overloaded virtual function @@ -195,7 +190,14 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif() target_link_libraries(GraphicsEngineOpenGL-static PRIVATE ${PRIVATE_DEPENDENCIES} PUBLIC ${PUBLIC_DEPENDENCIES}) -target_link_libraries(GraphicsEngineOpenGL-shared PUBLIC GraphicsEngineOpenGL-static) +target_link_libraries(GraphicsEngineOpenGL-shared PRIVATE BuildSettings PUBLIC ${PUBLIC_DEPENDENCIES}) +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR + CMAKE_CXX_COMPILER_ID MATCHES "GNU") + target_link_libraries(GraphicsEngineOpenGL-shared PRIVATE -Wl,--whole-archive GraphicsEngineOpenGL-static -Wl,--no-whole-archive) +else() + target_link_libraries(GraphicsEngineOpenGL-shared PRIVATE GraphicsEngineOpenGL-static) +endif() + target_compile_definitions(GraphicsEngineOpenGL-shared PUBLIC ENGINE_DLL=1) if(PLATFORM_WIN32) diff --git a/Graphics/GraphicsEngineOpenGL/interface/RenderDeviceFactoryOpenGL.h b/Graphics/GraphicsEngineOpenGL/interface/RenderDeviceFactoryOpenGL.h index f868222d..93b8d8f4 100644 --- a/Graphics/GraphicsEngineOpenGL/interface/RenderDeviceFactoryOpenGL.h +++ b/Graphics/GraphicsEngineOpenGL/interface/RenderDeviceFactoryOpenGL.h @@ -68,7 +68,9 @@ public: }; -#if ENGINE_DLL && (PLATFORM_WIN32 || PLATFORM_UNIVERSAL_WINDOWS) +#if ENGINE_DLL && PLATFORM_WIN32 && defined(_MSC_VER) + +# define EXPLICITLY_LOAD_ENGINE_GL_DLL 1 typedef IEngineFactoryOpenGL* (*GetEngineFactoryOpenGLType)(); @@ -77,17 +79,17 @@ public: GetFactoryFunc = nullptr; std::string LibName = "GraphicsEngineOpenGL_"; -#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() ); |
