From 8037c879fba232aa4d389b95d5e4bbe9c80cae14 Mon Sep 17 00:00:00 2001 From: logzero Date: Fri, 1 May 2020 21:35:48 +0200 Subject: Use export map to restrict visible lib symbols under MinGW. --- Graphics/GraphicsEngineOpenGL/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/CMakeLists.txt b/Graphics/GraphicsEngineOpenGL/CMakeLists.txt index 39d771e5..d7446208 100644 --- a/Graphics/GraphicsEngineOpenGL/CMakeLists.txt +++ b/Graphics/GraphicsEngineOpenGL/CMakeLists.txt @@ -217,6 +217,15 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU") # Disallow missing direct and indirect dependencies to enssure that .so is self-contained LINK_FLAGS "-Wl,--no-undefined -Wl,--no-allow-shlib-undefined" ) + if(PLATFORM_WIN32) + # Restrict export to GetEngineFactoryOpenGL + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/export.map + "{ global: *GetEngineFactoryOpenGL*; local: *; };" + ) + set_property(TARGET Diligent-GraphicsEngineOpenGL-shared APPEND_STRING PROPERTY + LINK_FLAGS " -Wl,--version-script=export.map" + ) + endif() endif() target_link_libraries(Diligent-GraphicsEngineOpenGL-static -- cgit v1.2.3