aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannah von Reth <vonreth@kde.org>2021-04-14 12:40:37 +0200
committerHannah von Reth <vonreth@kde.org>2021-04-14 12:40:37 +0200
commitec86df35bb23941403ec88f9a663a8a44fceae51 (patch)
tree38b85e1557b0e0c704bcba0bc01aee4bf2c3efc6
parent30c9698dd9a9a34a4f743824ee625171f805fcb9 (diff)
downloadextra-cmake-modules-ec86df35bb23941403ec88f9a663a8a44fceae51.tar.gz
extra-cmake-modules-ec86df35bb23941403ec88f9a663a8a44fceae51.tar.bz2
Fix static Windows builds by not setting /NODEFAULTLIB:libcmt /DEFAULTLIB:msvcrt
If we tell the compiler to link the runtime statically and then explicitly link the dynamic runtime and prohibit the static we continue to produce dynamic builds...
-rw-r--r--kde-modules/KDECompilerSettings.cmake30
1 files changed, 0 insertions, 30 deletions
diff --git a/kde-modules/KDECompilerSettings.cmake b/kde-modules/KDECompilerSettings.cmake
index ebad20eb..fcd80f30 100644
--- a/kde-modules/KDECompilerSettings.cmake
+++ b/kde-modules/KDECompilerSettings.cmake
@@ -450,36 +450,6 @@ if (APPLE)
set (CMAKE_MODULE_LINKER_FLAGS "-multiply_defined suppress ${CMAKE_MODULE_LINKER_FLAGS}")
endif()
-if (WIN32)
- if (MSVC OR CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
- # MSVC has four incompatible C runtime libraries: static (libcmt),
- # static debug (libcmtd), shared (msvcrt) and shared debug (msvcrtd):
- # see http://support.microsoft.com/kb/154753
- #
- # By default, when you create static libraries, they are automatically
- # linked against either libcmt or libcmtd, and when you create shared
- # libraries, they are automatically linked against either msvcrt or
- # msvcrtd. Trying to link to both a library that links to libcmt and
- # library that links to mscvrt, for example, will produce a warning as
- # described at
- # http://msdn.microsoft.com/en-us/library/aa267384%28VS.60%29.aspx
- # and can produce link errors like
- # "__thiscall type_info::type_info(class type_info const &)"
- # (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
- #
- # It is actually the options passed to the compiler, rather than the
- # linker, which control what will be linked (/MT, /MTd, /MD or /MDd),
- # but we can override this by telling the linker to ignore any "libcmt"
- # or "libcmtd" link suggestion embedded in the object files, and instead
- # link against the shared versions. That way, everything will link
- # against the same runtime library.
- set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/NODEFAULTLIB:libcmt /DEFAULTLIB:msvcrt ${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
- set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/NODEFAULTLIB:libcmt /DEFAULTLIB:msvcrt ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO}")
- set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "/NODEFAULTLIB:libcmt /DEFAULTLIB:msvcrt ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL}")
- set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/NODEFAULTLIB:libcmtd /DEFAULTLIB:msvcrtd ${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
- endif()
-endif()
-
if (MINGW AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# This was copied from the Phonon build settings, where it had the comment
# "otherwise undefined symbol in phononcore.dll errors occurs", with the commit