diff options
-rw-r--r-- | embedserv/Library_emser.mk | 8 | ||||
-rw-r--r-- | extensions/Library_oleautobridge.mk | 8 | ||||
-rw-r--r-- | extensions/Library_so_activex.mk | 8 | ||||
-rw-r--r-- | extensions/Library_so_activex_x64.mk | 8 | ||||
-rw-r--r-- | setup_native/Library_instooofiltmsi.mk | 2 | ||||
-rw-r--r-- | setup_native/Library_qslnkmsi.mk | 2 | ||||
-rw-r--r-- | setup_native/Library_reg4allmsdoc.mk | 2 | ||||
-rw-r--r-- | setup_native/Library_regactivex.mk | 2 | ||||
-rw-r--r-- | setup_native/Library_regpatchactivex.mk | 2 | ||||
-rw-r--r-- | setup_native/Library_sdqsmsi.mk | 2 | ||||
-rw-r--r-- | setup_native/Library_sellangmsi.mk | 2 | ||||
-rw-r--r-- | setup_native/Library_shlxtmsi.mk | 2 | ||||
-rw-r--r-- | setup_native/Library_sn_tools.mk | 2 | ||||
-rw-r--r-- | setup_native/StaticLibrary_quickstarter.mk | 2 | ||||
-rw-r--r-- | setup_native/StaticLibrary_seterror.mk | 2 | ||||
-rw-r--r-- | solenv/gbuild/gbuild.mk | 7 | ||||
-rwxr-xr-x | solenv/gbuild/platform/com_MSC_class.mk | 6 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_MSC_defs.mk | 4 | ||||
-rw-r--r-- | solenv/gcc-wrappers/wrapper.cxx | 6 |
19 files changed, 30 insertions, 47 deletions
diff --git a/embedserv/Library_emser.mk b/embedserv/Library_emser.mk index a4377f424ec5..5e30bf883362 100644 --- a/embedserv/Library_emser.mk +++ b/embedserv/Library_emser.mk @@ -58,15 +58,9 @@ $(eval $(call gb_Library_use_system_win32_libs,emser,\ uuid \ )) -ifeq ($(USE_DEBUG_RUNTIME),) $(eval $(call gb_Library_add_libs,emser,\ - $(ATL_LIB)/atls.lib \ + $(ATL_LIB)/$(if $(MSVC_USE_DEBUG_RUNTIME),atlsd.lib,atls.lib) \ )) -else -$(eval $(call gb_Library_add_libs,emser,\ - $(ATL_LIB)/atlsd.lib \ -)) -endif $(eval $(call gb_Library_add_ldflags,emser,\ -LIBPATH:$(ATL_LIB) \ diff --git a/extensions/Library_oleautobridge.mk b/extensions/Library_oleautobridge.mk index 32467f334b5a..fd1ccb9b5125 100644 --- a/extensions/Library_oleautobridge.mk +++ b/extensions/Library_oleautobridge.mk @@ -59,15 +59,9 @@ $(eval $(call gb_Library_use_system_win32_libs,oleautobridge,\ )) ifeq ($(COM),MSC) -ifneq ($(USE_DEBUG_RUNTIME),) $(eval $(call gb_Library_add_libs,oleautobridge,\ - $(ATL_LIB)/atlsd.lib \ + $(ATL_LIB)/$(if $(MSVC_USE_DEBUG_RUNTIME),atlsd.lib,atls.lib) \ )) -else -$(eval $(call gb_Library_add_libs,oleautobridge,\ - $(ATL_LIB)/atls.lib \ -)) -endif endif $(eval $(call gb_Library_add_exception_objects,oleautobridge,\ diff --git a/extensions/Library_so_activex.mk b/extensions/Library_so_activex.mk index 603a79c81c68..80571d8764bf 100644 --- a/extensions/Library_so_activex.mk +++ b/extensions/Library_so_activex.mk @@ -65,14 +65,8 @@ $(eval $(call gb_Library_use_system_win32_libs,so_activex,\ uuid \ )) -ifneq ($(USE_DEBUG_RUNTIME),) $(eval $(call gb_Library_add_libs,so_activex,\ - $(ATL_LIB)/atlsd.lib \ + $(ATL_LIB)/$(if $(MSVC_USE_DEBUG_RUNTIME),atlsd.lib,atls.lib) \ )) -else -$(eval $(call gb_Library_add_libs,so_activex,\ - $(ATL_LIB)/atls.lib \ -)) -endif # vim:set noet sw=4 ts=4: diff --git a/extensions/Library_so_activex_x64.mk b/extensions/Library_so_activex_x64.mk index c4f9546c0ecb..96ee19de3a90 100644 --- a/extensions/Library_so_activex_x64.mk +++ b/extensions/Library_so_activex_x64.mk @@ -68,14 +68,8 @@ $(eval $(call gb_Library_use_system_win32_libs,so_activex_x64,\ uuid \ )) -ifneq ($(USE_DEBUG_RUNTIME),) $(eval $(call gb_Library_add_libs,so_activex_x64,\ - $(ATL_LIB)/amd64/atlsd.lib \ + $(ATL_LIB)/amd64/$(if $(MSVC_USE_DEBUG_RUNTIME),atlsd.lib,atls.lib) \ )) -else -$(eval $(call gb_Library_add_libs,so_activex_x64,\ - $(ATL_LIB)/amd64/atls.lib \ -)) -endif # vim:set noet sw=4 ts=4: diff --git a/setup_native/Library_instooofiltmsi.mk b/setup_native/Library_instooofiltmsi.mk index 677e59003b17..a4c9fa8cc8cf 100644 --- a/setup_native/Library_instooofiltmsi.mk +++ b/setup_native/Library_instooofiltmsi.mk @@ -14,7 +14,7 @@ $(eval $(call gb_Library_add_defs,instooofiltmsi,\ )) $(eval $(call gb_Library_add_cxxflags,instooofiltmsi,\ - /MT \ + $(if $(MSVC_USE_DEBUG_RUNTIME),/MTd,/MT) \ )) $(eval $(call gb_Library_add_ldflags,instooofiltmsi,\ diff --git a/setup_native/Library_qslnkmsi.mk b/setup_native/Library_qslnkmsi.mk index 7f7bbb32d8bd..2e5e2fe6f6f5 100644 --- a/setup_native/Library_qslnkmsi.mk +++ b/setup_native/Library_qslnkmsi.mk @@ -14,7 +14,7 @@ $(eval $(call gb_Library_add_defs,qslnkmsi,\ )) $(eval $(call gb_Library_add_cxxflags,qslnkmsi,\ - /MT \ + $(if $(MSVC_USE_DEBUG_RUNTIME),/MTd,/MT) \ )) $(eval $(call gb_Library_add_ldflags,qslnkmsi,\ diff --git a/setup_native/Library_reg4allmsdoc.mk b/setup_native/Library_reg4allmsdoc.mk index 69f39030a0b1..671317639110 100644 --- a/setup_native/Library_reg4allmsdoc.mk +++ b/setup_native/Library_reg4allmsdoc.mk @@ -16,7 +16,7 @@ $(eval $(call gb_Library_add_defs,reg4allmsdoc,\ )) $(eval $(call gb_Library_add_cxxflags,reg4allmsdoc,\ - /MT \ + $(if $(MSVC_USE_DEBUG_RUNTIME),/MTd,/MT) \ )) $(eval $(call gb_Library_add_ldflags,reg4allmsdoc,\ diff --git a/setup_native/Library_regactivex.mk b/setup_native/Library_regactivex.mk index 4f561a5084c4..c823d7ce2cc2 100644 --- a/setup_native/Library_regactivex.mk +++ b/setup_native/Library_regactivex.mk @@ -14,7 +14,7 @@ $(eval $(call gb_Library_add_defs,regactivex,\ )) $(eval $(call gb_Library_add_cxxflags,regactivex,\ - /MT \ + $(if $(MSVC_USE_DEBUG_RUNTIME),/MTd,/MT) \ )) $(eval $(call gb_Library_add_ldflags,regactivex,\ diff --git a/setup_native/Library_regpatchactivex.mk b/setup_native/Library_regpatchactivex.mk index bd2669d5fade..30bf07d8b843 100644 --- a/setup_native/Library_regpatchactivex.mk +++ b/setup_native/Library_regpatchactivex.mk @@ -14,7 +14,7 @@ $(eval $(call gb_Library_add_defs,regpatchactivex,\ )) $(eval $(call gb_Library_add_cxxflags,regpatchactivex,\ - /MT \ + $(if $(MSVC_USE_DEBUG_RUNTIME),/MTd,/MT) \ )) $(eval $(call gb_Library_add_ldflags,regpatchactivex,\ diff --git a/setup_native/Library_sdqsmsi.mk b/setup_native/Library_sdqsmsi.mk index 73758358fde8..732159e7094d 100644 --- a/setup_native/Library_sdqsmsi.mk +++ b/setup_native/Library_sdqsmsi.mk @@ -14,7 +14,7 @@ $(eval $(call gb_Library_add_defs,sdqsmsi,\ )) $(eval $(call gb_Library_add_cxxflags,sdqsmsi,\ - /MT \ + $(if $(MSVC_USE_DEBUG_RUNTIME),/MTd,/MT) \ )) $(eval $(call gb_Library_add_ldflags,sdqsmsi,\ diff --git a/setup_native/Library_sellangmsi.mk b/setup_native/Library_sellangmsi.mk index 8411acd8d2ad..2979f1e6d31d 100644 --- a/setup_native/Library_sellangmsi.mk +++ b/setup_native/Library_sellangmsi.mk @@ -18,7 +18,7 @@ $(eval $(call gb_Library_add_defs,sellangmsi,\ )) $(eval $(call gb_Library_add_cxxflags,sellangmsi,\ - /MT \ + $(if $(MSVC_USE_DEBUG_RUNTIME),/MTd,/MT) \ )) $(eval $(call gb_Library_add_ldflags,sellangmsi,\ diff --git a/setup_native/Library_shlxtmsi.mk b/setup_native/Library_shlxtmsi.mk index 28fcdceb3e27..84fbe72f3741 100644 --- a/setup_native/Library_shlxtmsi.mk +++ b/setup_native/Library_shlxtmsi.mk @@ -16,7 +16,7 @@ $(eval $(call gb_Library_add_defs,shlxtmsi,\ )) $(eval $(call gb_Library_add_cxxflags,shlxtmsi,\ - /MT \ + $(if $(MSVC_USE_DEBUG_RUNTIME),/MTd,/MT) \ )) $(eval $(call gb_Library_add_ldflags,shlxtmsi,\ diff --git a/setup_native/Library_sn_tools.mk b/setup_native/Library_sn_tools.mk index da93c89b9d63..c857d0daf710 100644 --- a/setup_native/Library_sn_tools.mk +++ b/setup_native/Library_sn_tools.mk @@ -14,7 +14,7 @@ $(eval $(call gb_Library_add_defs,sn_tools,\ )) $(eval $(call gb_Library_add_cxxflags,sn_tools,\ - /MT \ + $(if $(MSVC_USE_DEBUG_RUNTIME),/MTd,/MT) \ )) $(eval $(call gb_Library_add_ldflags,sn_tools,\ diff --git a/setup_native/StaticLibrary_quickstarter.mk b/setup_native/StaticLibrary_quickstarter.mk index 399f6afe5b0a..0517a7511016 100644 --- a/setup_native/StaticLibrary_quickstarter.mk +++ b/setup_native/StaticLibrary_quickstarter.mk @@ -14,7 +14,7 @@ $(eval $(call gb_StaticLibrary_add_defs,quickstarter,\ )) $(eval $(call gb_StaticLibrary_add_cxxflags,quickstarter,\ - /MT \ + $(if $(MSVC_USE_DEBUG_RUNTIME),/MTd,/MT) \ )) $(eval $(call gb_StaticLibrary_add_exception_objects,quickstarter,\ diff --git a/setup_native/StaticLibrary_seterror.mk b/setup_native/StaticLibrary_seterror.mk index bb6ccf922287..92297690419b 100644 --- a/setup_native/StaticLibrary_seterror.mk +++ b/setup_native/StaticLibrary_seterror.mk @@ -14,7 +14,7 @@ $(eval $(call gb_StaticLibrary_add_defs,seterror,\ )) $(eval $(call gb_StaticLibrary_add_cxxflags,seterror,\ - /MT \ + $(if $(MSVC_USE_DEBUG_RUNTIME),/MTd,/MT) \ )) $(eval $(call gb_StaticLibrary_add_exception_objects,seterror,\ diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk index 87a5c6570fb5..def5ff81db9a 100644 --- a/solenv/gbuild/gbuild.mk +++ b/solenv/gbuild/gbuild.mk @@ -224,11 +224,10 @@ gb_GLOBALDEFS += \ -DLIBO_INTERNAL_ONLY \ ifeq ($(gb_ENABLE_DBGUTIL),$(true)) -gb_GLOBALDEFS += -DDBG_UTIL \ - -ifneq ($(COM),MSC) -gb_GLOBALDEFS += -D_DEBUG \ +gb_GLOBALDEFS += -DDBG_UTIL +ifneq ($(COM)-$(MSVC_USE_DEBUG_RUNTIME),MSC-) +gb_GLOBALDEFS += -D_DEBUG endif endif diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk index 861626bd7e2f..8b5421fe54e4 100755 --- a/solenv/gbuild/platform/com_MSC_class.mk +++ b/solenv/gbuild/platform/com_MSC_class.mk @@ -218,8 +218,12 @@ $(call gb_Helper_abbreviate_dirs,\ ; exit $$RC) endef +define gb_MSVCRT_subst +$(if $(MSVC_USE_DEBUG_RUNTIME),$(subst msvcrt,msvcrtd,$(subst msvcprt,msvcprtd,$(subst libcmt,libcmtd,$(subst libcpmt,libcpmtd,$(subst msvcmrt,msvcmrtd,$(1)))))),$(1)) +endef + define gb_LinkTarget_use_system_win32_libs -$(call gb_LinkTarget_add_libs,$(1),$(foreach lib,$(2),$(lib).lib)) +$(call gb_LinkTarget_add_libs,$(1),$(foreach lib,$(2),$(call gb_MSVCRT_subst,$(lib)).lib)) endef # Flags common for PE executables (EXEs and DLLs) diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk index 18e1f0a375bf..439afa51feaf 100644 --- a/solenv/gbuild/platform/com_MSC_defs.mk +++ b/solenv/gbuild/platform/com_MSC_defs.mk @@ -148,7 +148,7 @@ gb_CFLAGS := \ -GR \ -Gs \ -GS \ - -MD \ + $(if $(MSVC_USE_DEBUG_RUNTIME),-MDd,-MD) \ -nologo \ -W4 \ -wd4127 \ @@ -181,7 +181,7 @@ gb_CXXFLAGS := \ -Gs \ -GS \ -Gy \ - -MD \ + $(if $(MSVC_USE_DEBUG_RUNTIME),-MDd,-MD) \ -nologo \ -W4 \ -wd4127 \ diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx index a768eefaa362..151979ca7991 100644 --- a/solenv/gcc-wrappers/wrapper.cxx +++ b/solenv/gcc-wrappers/wrapper.cxx @@ -72,7 +72,11 @@ string processccargs(vector<string> rawargs) { string args=" -nologo"; // TODO: should these options be enabled globally? args.append(" -EHsc"); - args.append(" -MD"); + const char *const pDebugRuntime(getenv("MSVC_USE_DEBUG_RUNTIME")); + if (pDebugRuntime && !strcmp(pDebugRuntime, "TRUE")) + args.append(" -MDd"); + else + args.append(" -MD"); args.append(" -Gy"); args.append(" -Zc:wchar_t-"); args.append(" -Ob1 -Oxs -Oy-"); |