summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2018-12-18 10:21:36 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-01-14 11:21:58 +0000
commitd014c8c11fb663f131d3a860ddeda17d604b2dd3 (patch)
treebc31a6fe5cd0b9e66dff2e90d6151e0b3df6124e
parentcf64c9413a2264aa67e26c6302342ff4aa99a575 (diff)
downloadopenembedded-core-contrib-d014c8c11fb663f131d3a860ddeda17d604b2dd3.tar.gz
openembedded-core-contrib-d014c8c11fb663f131d3a860ddeda17d604b2dd3.tar.bz2
openembedded-core-contrib-d014c8c11fb663f131d3a860ddeda17d604b2dd3.zip
cmake.bbclass: Make it work with ccache
This can make the following recipes work with cmake: cmake libdnf libcomps librepo createrepo-c llvm dnf libsolv assimp waffle libjpeg-turbo taglib libproxy libical And the following 3 recipes don't: webkitgtk vulkan piglit Now cmake.bbclass doesn't disble ccache any more, disable it in the recipes if needed. Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
-rw-r--r--meta/classes/cmake.bbclass21
-rw-r--r--meta/recipes-graphics/piglit/piglit_git.bb3
-rw-r--r--meta/recipes-graphics/vulkan/vulkan_1.1.73.0.bb3
-rw-r--r--meta/recipes-sato/webkit/webkitgtk_2.22.5.bb3
4 files changed, 24 insertions, 6 deletions
diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index f22d90a1d5..fa7f68c99b 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -4,9 +4,6 @@ OECMAKE_SOURCEPATH ??= "${S}"
DEPENDS_prepend = "cmake-native "
B = "${WORKDIR}/build"
-# We need to unset CCACHE otherwise cmake gets too confused
-CCACHE = ""
-
# What CMake generator to use.
# The supported options are "Unix Makefiles" or "Ninja".
OECMAKE_GENERATOR ?= "Ninja"
@@ -23,10 +20,22 @@ python() {
d.setVarFlag("do_compile", "progress", r"outof:^\[(\d+)/(\d+)\]\s+")
else:
bb.fatal("Unknown CMake Generator %s" % generator)
+
+ # C/C++ Compiler (without cpu arch/tune arguments)
+ if not d.getVar('OECMAKE_C_COMPILER'):
+ cc_list = d.getVar('CC').split()
+ if cc_list[0] == 'ccache':
+ d.setVar('OECMAKE_C_COMPILER', '%s %s' % (cc_list[0], cc_list[1]))
+ else:
+ d.setVar('OECMAKE_C_COMPILER', cc_list[0])
+
+ if not d.getVar('OECMAKE_CXX_COMPILER'):
+ cxx_list = d.getVar('CXX').split()
+ if cxx_list[0] == 'ccache':
+ d.setVar('OECMAKE_CXX_COMPILER', '%s %s' % (cxx_list[0], cxx_list[1]))
+ else:
+ d.setVar('OECMAKE_CXX_COMPILER', cxx_list[0])
}
-# C/C++ Compiler (without cpu arch/tune arguments)
-OECMAKE_C_COMPILER ?= "`echo ${CC} | sed 's/^\([^ ]*\).*/\1/'`"
-OECMAKE_CXX_COMPILER ?= "`echo ${CXX} | sed 's/^\([^ ]*\).*/\1/'`"
OECMAKE_AR ?= "${AR}"
# Compiler flags
diff --git a/meta/recipes-graphics/piglit/piglit_git.bb b/meta/recipes-graphics/piglit/piglit_git.bb
index 622e0462b3..59d134801a 100644
--- a/meta/recipes-graphics/piglit/piglit_git.bb
+++ b/meta/recipes-graphics/piglit/piglit_git.bb
@@ -52,3 +52,6 @@ RDEPENDS_${PN} = "waffle waffle-bin python3 python3-mako python3-json \
"
INSANE_SKIP_${PN} += "dev-so already-stripped"
+
+# Can't be built with ccache
+CCACHE_DISABLE = "1"
diff --git a/meta/recipes-graphics/vulkan/vulkan_1.1.73.0.bb b/meta/recipes-graphics/vulkan/vulkan_1.1.73.0.bb
index dd3adeeb0d..02e4330cf2 100644
--- a/meta/recipes-graphics/vulkan/vulkan_1.1.73.0.bb
+++ b/meta/recipes-graphics/vulkan/vulkan_1.1.73.0.bb
@@ -35,3 +35,6 @@ PACKAGECONFIG[wayland] = "-DBUILD_WSI_WAYLAND_SUPPORT=ON, -DBUILD_WSI_WAYLAND_SU
RRECOMMENDS_${PN} = "mesa-vulkan-drivers"
INSANE_SKIP_${PN}-dev += "dev-elf"
+
+# Can't be built with ccache
+CCACHE_DISABLE = "1"
diff --git a/meta/recipes-sato/webkit/webkitgtk_2.22.5.bb b/meta/recipes-sato/webkit/webkitgtk_2.22.5.bb
index fc56822f7a..2e79f739ea 100644
--- a/meta/recipes-sato/webkit/webkitgtk_2.22.5.bb
+++ b/meta/recipes-sato/webkit/webkitgtk_2.22.5.bb
@@ -121,3 +121,6 @@ ARM_INSTRUCTION_SET_armv7ve = "thumb"
# Segmentation fault
GI_DATA_ENABLED_armv7a = "False"
GI_DATA_ENABLED_armv7ve = "False"
+
+# Can't be built with ccache
+CCACHE_DISABLE = "1"