From 81b89ed0099696e881ef21f15d7f3a416d85cd8e Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 8 Feb 2022 08:14:07 +0100 Subject: external/libwebp: Support clang-cl ...fixing > Makefile.vc(18) : fatal error U1050: Unable to auto-detect toolchain architecture! If cl.exe is in your PATH rerun nmake with ARCH=. because workdir/UnpackedTarball/libwebp/Makefile.vc naively relies on cl.exe- specific output details in > !IFNDEF ARCH > !IF ! [ $(CC) 2>&1 | grep -q "x86" > NUL ] > ARCH = x86 > !ELSE IF ! [ $(CC) 2>&1 | grep -q "x64" > NUL ] > ARCH = x64 > !ELSE IF ! [ $(CC) 2>&1 | grep -q "ARM" > NUL ] > ARCH = ARM > !ELSE > !ERROR Unable to auto-detect toolchain architecture! \ > If cl.exe is in your PATH rerun nmake with ARCH=. > !ENDIF > !ENDIF Change-Id: I376295fc75d6ab19773e53dbb607d3b156fbe948 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129655 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- external/libwebp/ExternalProject_libwebp.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/external/libwebp/ExternalProject_libwebp.mk b/external/libwebp/ExternalProject_libwebp.mk index beb7a39e7b64..f62d4846d68e 100644 --- a/external/libwebp/ExternalProject_libwebp.mk +++ b/external/libwebp/ExternalProject_libwebp.mk @@ -16,10 +16,15 @@ $(eval $(call gb_ExternalProject_register_targets,libwebp,\ ifeq ($(COM),MSC) $(eval $(call gb_ExternalProject_use_nmake,libwebp,build)) +# Explicitly passing in ARCH (for the known architectures, at least) avoids +# workdir/UnpackedTarball/libwebp/Makefile.vc not being able to detect it when CC is clang-cl: $(call gb_ExternalProject_get_state_target,libwebp,build): $(call gb_Trace_StartRange,libwebp,EXTERNAL) $(call gb_ExternalProject_run,build,\ nmake -nologo -f Makefile.vc CFG=release-static RTLIBCFG=static OBJDIR=output \ + $(if $(filter INTEL,$(CPUNAME)),ARCH=x86, \ + $(if $(filter X86_64,$(CPUNAME)),ARCH=x64, \ + $(if $(filter AARCH64,$(CPUNAME)),ARCH=ARM))) \ ) $(call gb_Trace_EndRange,libwebp,EXTERNAL) else -- cgit