aboutsummaryrefslogtreecommitdiff
path: root/cmake/compiler/msvc/settings.cmake
diff options
context:
space:
mode:
authorNaios <naios-dev@live.de>2016-03-20 00:50:21 +0100
committerNaios <naios-dev@live.de>2016-03-24 02:38:54 +0100
commit2613413608337d61994503df0e2d9ed05d3c4ee4 (patch)
treec560bb1832b8a9aa13837dd662bfb9fa514475f4 /cmake/compiler/msvc/settings.cmake
parentf37682b7edd0d711e1120cbdd9d627fb5b9dbde1 (diff)
Core/Build: Add the possibility to link libraries dynamically.
* makes it possible to access exported singletons from other shared lib's. * reduces binary size (cherry picked from commit f4e0945b13a70225684e7421d9542efae6a47c89)
Diffstat (limited to 'cmake/compiler/msvc/settings.cmake')
-rw-r--r--cmake/compiler/msvc/settings.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmake/compiler/msvc/settings.cmake b/cmake/compiler/msvc/settings.cmake
index 8af8033d809..994a5318ea4 100644
--- a/cmake/compiler/msvc/settings.cmake
+++ b/cmake/compiler/msvc/settings.cmake
@@ -74,6 +74,13 @@ if(NOT WITH_WARNINGS)
message(STATUS "MSVC: Disabled generic compiletime warnings")
endif()
+if (WITH_DYNAMIC_LINKING)
+ # C4251: needs to have dll-interface to be used by clients of class '...'
+ # C4275: non dll-interface class ...' used as base for dll-interface class '...'
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251 /wd4275")
+ message(STATUS "MSVC: Enabled shared linking")
+endif()
+
# Specify the maximum PreCompiled Header memory allocation limit
# Fixes a compiler-problem when using PCH - the /Ym flag is adjusted by the compiler in MSVC2012, hence we need to set an upper limit with /Zm to avoid discrepancies)
# (And yes, this is a verified , unresolved bug with MSVC... *sigh*)