[oe-commits] [openembedded-core] 10/27: cmake.bbclass: Make it work with ccache

git at git.openembedded.org git at git.openembedded.org
Mon Jan 14 11:22:59 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit d014c8c11fb663f131d3a860ddeda17d604b2dd3
Author: Robert Yang <liezhi.yang at windriver.com>
AuthorDate: Tue Dec 18 10:21:36 2018 +0800

    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 at windriver.com>
---
 meta/classes/cmake.bbclass                      | 21 +++++++++++++++------
 meta/recipes-graphics/piglit/piglit_git.bb      |  3 +++
 meta/recipes-graphics/vulkan/vulkan_1.1.73.0.bb |  3 +++
 meta/recipes-sato/webkit/webkitgtk_2.22.5.bb    |  3 +++
 4 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index f22d90a..fa7f68c 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 622e046..59d1348 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 dd3adee..02e4330 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 fc56822..2e79f73 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"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list