summaryrefslogtreecommitdiff
path: root/solenv/gbuild/platform
diff options
context:
space:
mode:
Diffstat (limited to 'solenv/gbuild/platform')
-rw-r--r--solenv/gbuild/platform/com_MSC_class.mk10
-rwxr-xr-x[-rw-r--r--]solenv/gbuild/platform/com_MSC_defs.mk57
2 files changed, 42 insertions, 25 deletions
diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index f55559c71e66..1aef9384d8fc 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -40,11 +40,15 @@ $(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) $(dir $(4)) && \
unset INCLUDE && \
$(if $(filter YES,$(CXXOBJECT_X64)), $(CXX_X64_BINARY), \
- $(if $(filter %.c,$(3)), $(gb_CC), $(gb_CXX))) \
+ $(if $(filter %.c,$(3)), $(gb_CC), \
+ $(if $(filter -clr,$(2)), \
+ $(MSVC_CXX) -I$(SRCDIR)/solenv/clang-cl,$(gb_CXX)))) \
$(DEFS) \
$(gb_LTOFLAGS) \
$(2) \
- $(if $(EXTERNAL_CODE),$(if $(COM_IS_CLANG),-Wno-undef),$(gb_DEFS_INTERNAL)) \
+ $(if $(EXTERNAL_CODE), \
+ $(if $(filter -clr,$(2)),,$(if $(COM_IS_CLANG),-Wno-undef)), \
+ $(gb_DEFS_INTERNAL)) \
$(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
-Fd$(PDBFILE) \
$(PCHFLAGS) \
@@ -105,6 +109,7 @@ endef
gb_LinkTarget_CFLAGS := $(gb_CFLAGS)
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS)
+gb_LinkTarget_CXXCLRFLAGS := $(gb_CXXCLRFLAGS)
gb_LinkTarget_INCLUDE :=\
$(subst -I. , ,$(SOLARINC)) \
@@ -157,6 +162,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
$(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \
+ $(foreach object,$(CXXCLROBJECTS),$(call gb_CxxClrObject_get_target,$(object))) \
$(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \
$(foreach extraobjectlist,$(EXTRAOBJECTLISTS),$(shell cat $(extraobjectlist))) \
$(PCHOBJS) $(NATIVERES)) && \
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index 5e7c2e689438..a6b1b32d8c3d 100644..100755
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -152,16 +152,7 @@ gb_CFLAGS := \
-wd4706 \
-wd4800 \
-ifeq ($(COM_IS_CLANG),TRUE)
-gb_CFLAGS += \
- -Wdeclaration-after-statement \
- -Wendif-labels \
- -Wshadow \
- -Wstrict-prototypes \
- -Wundef \
- -Wunused-macros \
-
-else
+ifneq ($(COM_IS_CLANG),TRUE)
gb_CFLAGS += \
$(if $(filter-out 120,$(VCVER)), -Wv:18 -wd4267) \
@@ -212,19 +203,7 @@ gb_CFLAGS += \
endif
-ifeq ($(COM_IS_CLANG),TRUE)
-gb_CXXFLAGS += \
- -Wendif-labels \
- -Wimplicit-fallthrough \
- -Wno-missing-braces \
- -Wno-missing-braces \
- -Wnon-virtual-dtor \
- -Woverloaded-virtual \
- -Wshadow \
- -Wundef \
- -Wunused-macros \
-
-else
+ifneq ($(COM_IS_CLANG),TRUE)
gb_CXXFLAGS += \
$(if $(filter-out 120,$(VCVER)), -Wv:18 -wd4267) \
@@ -290,6 +269,38 @@ endif
gb_LTOFLAGS := $(if $(filter TRUE,$(ENABLE_LTO)),-GL)
+# When compiling for CLR, disable "warning C4339: use of undefined type detected
+# in CLR meta-data - use of this type may lead to a runtime exception":
+gb_CXXCLRFLAGS := $(gb_CXXFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) \
+ -AI $(INSTDIR)/$(LIBO_URE_LIB_FOLDER) \
+ -EHa \
+ -clr \
+ -wd4339 \
+ $(if $(filter-out 120,$(VCVER)), -Wv:18 -wd4267) \
+
+ifeq ($(COM_IS_CLANG),TRUE)
+
+gb_CFLAGS += \
+ -Wdeclaration-after-statement \
+ -Wendif-labels \
+ -Wshadow \
+ -Wstrict-prototypes \
+ -Wundef \
+ -Wunused-macros \
+
+gb_CXXFLAGS += \
+ -Wendif-labels \
+ -Wimplicit-fallthrough \
+ -Wno-missing-braces \
+ -Wno-missing-braces \
+ -Wnon-virtual-dtor \
+ -Woverloaded-virtual \
+ -Wshadow \
+ -Wundef \
+ -Wunused-macros \
+
+endif
+
# Helper class
ifeq ($(GNUMAKE_WIN_NATIVE),TRUE)