]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
openvpnmsica: link C runtime statically
authorLev Stipakov <lev@openvpn.net>
Wed, 5 Jul 2023 12:25:28 +0000 (15:25 +0300)
committerGert Doering <gert@greenie.muc.de>
Wed, 5 Jul 2023 16:17:00 +0000 (18:17 +0200)
By default CMake links C runtime dynamically,
which doesn't work on Windows 7, for example.

This is not an issue with other openvpn binaries,
since we bundle C runtime, but it is not yet available
during installation.

Change-Id: Ib2b014f075908e7db0d9115abaa2240e47fd27b9
Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Message-Id: <20230705122528.1625-1-lstipakov@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26821.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpnmsica/CMakeLists.txt

index 683d38e0ab22ca0481e442eba7fb4d18bb2a9420..9126b80f499e92de578754505988eaa74191c5f9 100644 (file)
@@ -26,6 +26,14 @@ target_compile_options(openvpnmsica PRIVATE
     -UNTDDI_VERSION
     -D_WIN32_WINNT=_WIN32_WINNT_VISTA
     )
+
+if (MSVC)
+    target_compile_options(openvpnmsica PRIVATE
+        "$<$<CONFIG:Release>:/MT>"
+        "$<$<CONFIG:Debug>:/MTd>"
+        )
+endif ()
+
 target_link_libraries(openvpnmsica
     advapi32.lib ole32.lib msi.lib setupapi.lib iphlpapi.lib shell32.lib shlwapi.lib version.lib newdev.lib)
 if (MINGW)