summaryrefslogtreecommitdiff
path: root/solenv/gbuild/platform/com_MSC_class.mk
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-04-17 11:34:25 +0200
committerLuboš Luňák <l.lunak@collabora.com>2020-04-20 11:16:01 +0200
commit647499ef8151d9383983f89230a970edcb44b5bb (patch)
tree83c9dfc573b80aeb8eef5307e0838833a1e74707 /solenv/gbuild/platform/com_MSC_class.mk
parent68531e459e7a922319e6bfe8b7a5282ba0320182 (diff)
prefer building Skia with Clang if possible (tdf#131697)
I.e. try to find and use Clang even if the default compiler is something else. Skia is optimized to be built with Clang(-cl) and in CPU-based raster mode some operations are several times slower if built with something else (e.g. fmax/fmin do not get optimized to inline assembly). It is enough to select Clang to be installed in the MSVS installer. At this point it unclear how to handle release binaries, if it should work this way and enforced, or maybe Clang could be used for building everything, or maybe some other way. Change-Id: I6b95a0f2d5cbf176942d9e01136990b14be6dba8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92415 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'solenv/gbuild/platform/com_MSC_class.mk')
-rw-r--r--solenv/gbuild/platform/com_MSC_class.mk14
1 files changed, 8 insertions, 6 deletions
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) \