meson: fix building host binaries with ccache

With CONFIG_CCACHE, $HOSTCC is 'ccache gcc' while $TARGET_CC points to a
single wrapper script. Compiling target binaries with ccache works, but
doesn't for host binaries, because we need to supply an argv array for
argc > 1 in the meson cross file.

Always pass an array for the c and c++ compiler, and while at it, do it
for the target as well - just to be on the safe side if that ever
changes.

Fixes #10982.

Signed-off-by: Andre Heider <a.heider@gmail.com>
(cherry picked from commit f5c8565d1b)
This commit is contained in:
Andre Heider 2020-01-11 18:40:41 +01:00 committed by Josef Schlehofer
parent eeeadde02c
commit c7e1a34531
No known key found for this signature in database
GPG key ID: B950216FE4329F4C
3 changed files with 8 additions and 8 deletions

View file

@ -42,8 +42,8 @@ endef
define Meson/CreateNativeFile define Meson/CreateNativeFile
$(STAGING_DIR_HOST)/bin/sed \ $(STAGING_DIR_HOST)/bin/sed \
-e "s|@CC@|$(HOSTCC)|" \ -e "s|@CC@|$(foreach BIN,$(HOSTCC),'$(BIN)',)|" \
-e "s|@CXX@|$(HOSTCXX)|" \ -e "s|@CXX@|$(foreach BIN,$(HOSTCXX),'$(BIN)',)|" \
-e "s|@PKGCONFIG@|$(PKG_CONFIG)|" \ -e "s|@PKGCONFIG@|$(PKG_CONFIG)|" \
-e "s|@CFLAGS@|$(foreach FLAG,$(HOST_CFLAGS) $(HOST_CPPFLAGS),'$(FLAG)',)|" \ -e "s|@CFLAGS@|$(foreach FLAG,$(HOST_CFLAGS) $(HOST_CPPFLAGS),'$(FLAG)',)|" \
-e "s|@CXXFLAGS@|$(foreach FLAG,$(HOST_CXXFLAGS) $(HOST_CPPFLAGS),'$(FLAG)',)|" \ -e "s|@CXXFLAGS@|$(foreach FLAG,$(HOST_CXXFLAGS) $(HOST_CPPFLAGS),'$(FLAG)',)|" \
@ -55,8 +55,8 @@ endef
define Meson/CreateCrossFile define Meson/CreateCrossFile
$(STAGING_DIR_HOST)/bin/sed \ $(STAGING_DIR_HOST)/bin/sed \
-e "s|@CC@|$(TARGET_CC)|" \ -e "s|@CC@|$(foreach BIN,$(TARGET_CC),'$(BIN)',)|" \
-e "s|@CXX@|$(TARGET_CXX)|" \ -e "s|@CXX@|$(foreach BIN,$(TARGET_CXX),'$(BIN)',)|" \
-e "s|@AR@|$(TARGET_AR)|" \ -e "s|@AR@|$(TARGET_AR)|" \
-e "s|@STRIP@|$(TARGET_CROSS)strip|" \ -e "s|@STRIP@|$(TARGET_CROSS)strip|" \
-e "s|@NM@|$(TARGET_NM)|" \ -e "s|@NM@|$(TARGET_NM)|" \

View file

@ -1,6 +1,6 @@
[binaries] [binaries]
c = '@CC@' c = [@CC@]
cpp = '@CXX@' cpp = [@CXX@]
ar = '@AR@' ar = '@AR@'
strip = '@STRIP@' strip = '@STRIP@'
nm = '@NM@' nm = '@NM@'

View file

@ -1,6 +1,6 @@
[binaries] [binaries]
c = '@CC@' c = [@CC@]
cpp = '@CXX@' cpp = [@CXX@]
pkgconfig = '@PKGCONFIG@' pkgconfig = '@PKGCONFIG@'
[properties] [properties]