summaryrefslogtreecommitdiff
path: root/solenv/gbuild/platform
diff options
context:
space:
mode:
Diffstat (limited to 'solenv/gbuild/platform')
-rw-r--r--solenv/gbuild/platform/com_GCC_class.mk13
-rw-r--r--solenv/gbuild/platform/com_MSC_class.mk14
2 files changed, 18 insertions, 9 deletions
diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk
index 29de22fe8634..f7e553dd5dc8 100644
--- a/solenv/gbuild/platform/com_GCC_class.mk
+++ b/solenv/gbuild/platform/com_GCC_class.mk
@@ -52,13 +52,20 @@ endef
# CObject class
-# $(call gb_CObject__command_pattern,object,flags,source,dep-file,compiler-plugins,symbols)
+# $(call gb_CObject__compiler,source,compiler)
+define gb_CObject__compiler
+ $(if $(filter %.c %.m,$(1)), \
+ $(if $(2), $(2), $(gb_CC)), \
+ $(if $(2), $(2), $(gb_CXX)))
+endef
+
+# $(call gb_CObject__command_pattern,object,flags,source,dep-file,compiler-plugins,symbols,compiler)
define gb_CObject__command_pattern
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) $(dir $(4)) && cd $(SRCDIR) && \
$(gb_COMPILER_SETUP) \
$(if $(5),$(gb_COMPILER_PLUGINS_SETUP)) \
- $(if $(filter %.c %.m,$(3)), $(gb_CC), $(gb_CXX)) \
+ $(call gb_CObject__compiler,$(3),$(7)) \
$(DEFS) \
$(gb_LTOFLAGS) \
$(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
@@ -116,7 +123,7 @@ $(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) $(dir $(call gb_PrecompiledHeader_get_dep_target,$(2),$(7))) && \
cd $(BUILDDIR)/ && \
CCACHE_DISABLE=1 $(gb_COMPILER_SETUP) \
- $(gb_CXX) \
+ $(if $(8),$(8),$(gb_CXX)) \
-x c++-header \
$(4) $(5) \
$(if $(WARNINGS_DISABLED),$(gb_CXXFLAGS_DISABLE_WARNINGS)) \
diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index f72c2a55f16b..848cb96397e3 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -34,13 +34,15 @@ endef
# CObject class
-# $(call gb_CObject__compiler,flags,source)
+# $(call gb_CObject__compiler,flags,source,compiler)
define gb_CObject__compiler
$(if $(filter YES,$(LIBRARY_X64)), $(CXX_X64_BINARY), \
$(if $(filter YES,$(PE_X86)), $(CXX_X86_BINARY), \
- $(if $(filter %.c,$(2)), $(gb_CC), \
+ $(if $(filter %.c,$(2)), \
+ $(if $(3), $(3), $(gb_CC)), \
$(if $(filter -clr,$(1)), \
- $(MSVC_CXX) -I$(SRCDIR)/solenv/clang-cl,$(gb_CXX)))))
+ $(MSVC_CXX) -I$(SRCDIR)/solenv/clang-cl,
+ $(if $(3), $(3), $(gb_CXX))))))
endef
# Avoid annoying warning D9025 about overriding command-line arguments.
@@ -50,12 +52,12 @@ gb_Helper_remove_overridden_flags = \
$(lastword $(filter -Od -O2,$(1))) \
$(lastword $(filter -arch:SSE -arch:SSE2 -arch:AVX -arch:AVX2,$(1)))
-# $(call gb_CObject__command_pattern,object,flags,source,dep-file,compiler-plugins,symbols)
+# $(call gb_CObject__command_pattern,object,flags,source,dep-file,compiler-plugins,symbols,compiler)
define gb_CObject__command_pattern
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) $(dir $(4)) && \
unset INCLUDE && \
- $(filter-out -arch:SSE,$(call gb_CObject__compiler,$(2),$(3))) \
+ $(filter-out -arch:SSE,$(call gb_CObject__compiler,$(2),$(3),$(7))) \
$(DEFS) \
$(gb_LTOFLAGS) \
$(call gb_Helper_remove_overridden_flags,$(filter -arch:SSE,$(call gb_CObject__compiler,$(2),$(3))) \
@@ -96,7 +98,7 @@ $(call gb_Output_announce,$(2),$(true),PCH,1)
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) $(dir $(call gb_PrecompiledHeader_get_dep_target,$(2),$(7))) && \
unset INCLUDE && \
- $(filter-out -arch:SSE,$(call gb_CObject__compiler,$(4) $(5),$(3))) \
+ $(filter-out -arch:SSE,$(call gb_CObject__compiler,$(4) $(5),$(3),$(8))) \
$(call gb_Helper_remove_overridden_flags,$(filter -arch:SSE,$(call gb_CObject__compiler,$(4) $(5),$(3))) \
$(4) $(5) $(if $(WARNINGS_DISABLED),$(gb_CXXFLAGS_DISABLE_WARNINGS))) \
-Fd$(PDBFILE) \