diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2018-12-18 10:21:36 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-01-14 11:35:55 +0000 |
commit | 3be36b0d27d89cff3dfd5ee7f0906afaccf9c9e5 (patch) | |
tree | f5a044adda1974009dca447fcc03a6a2c5f3b2e1 /meta/classes/cmake.bbclass | |
parent | 7a713b0fbf310c0b2b94aaa6caa555fe336bf85d (diff) | |
download | poky-3be36b0d27d89cff3dfd5ee7f0906afaccf9c9e5.tar.gz |
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.
(From OE-Core rev: d014c8c11fb663f131d3a860ddeda17d604b2dd3)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/cmake.bbclass')
-rw-r--r-- | meta/classes/cmake.bbclass | 21 |
1 files changed, 15 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}" | |||
4 | DEPENDS_prepend = "cmake-native " | 4 | DEPENDS_prepend = "cmake-native " |
5 | B = "${WORKDIR}/build" | 5 | B = "${WORKDIR}/build" |
6 | 6 | ||
7 | # We need to unset CCACHE otherwise cmake gets too confused | ||
8 | CCACHE = "" | ||
9 | |||
10 | # What CMake generator to use. | 7 | # What CMake generator to use. |
11 | # The supported options are "Unix Makefiles" or "Ninja". | 8 | # The supported options are "Unix Makefiles" or "Ninja". |
12 | OECMAKE_GENERATOR ?= "Ninja" | 9 | OECMAKE_GENERATOR ?= "Ninja" |
@@ -23,10 +20,22 @@ python() { | |||
23 | d.setVarFlag("do_compile", "progress", r"outof:^\[(\d+)/(\d+)\]\s+") | 20 | d.setVarFlag("do_compile", "progress", r"outof:^\[(\d+)/(\d+)\]\s+") |
24 | else: | 21 | else: |
25 | bb.fatal("Unknown CMake Generator %s" % generator) | 22 | bb.fatal("Unknown CMake Generator %s" % generator) |
23 | |||
24 | # C/C++ Compiler (without cpu arch/tune arguments) | ||
25 | if not d.getVar('OECMAKE_C_COMPILER'): | ||
26 | cc_list = d.getVar('CC').split() | ||
27 | if cc_list[0] == 'ccache': | ||
28 | d.setVar('OECMAKE_C_COMPILER', '%s %s' % (cc_list[0], cc_list[1])) | ||
29 | else: | ||
30 | d.setVar('OECMAKE_C_COMPILER', cc_list[0]) | ||
31 | |||
32 | if not d.getVar('OECMAKE_CXX_COMPILER'): | ||
33 | cxx_list = d.getVar('CXX').split() | ||
34 | if cxx_list[0] == 'ccache': | ||
35 | d.setVar('OECMAKE_CXX_COMPILER', '%s %s' % (cxx_list[0], cxx_list[1])) | ||
36 | else: | ||
37 | d.setVar('OECMAKE_CXX_COMPILER', cxx_list[0]) | ||
26 | } | 38 | } |
27 | # C/C++ Compiler (without cpu arch/tune arguments) | ||
28 | OECMAKE_C_COMPILER ?= "`echo ${CC} | sed 's/^\([^ ]*\).*/\1/'`" | ||
29 | OECMAKE_CXX_COMPILER ?= "`echo ${CXX} | sed 's/^\([^ ]*\).*/\1/'`" | ||
30 | OECMAKE_AR ?= "${AR}" | 39 | OECMAKE_AR ?= "${AR}" |
31 | 40 | ||
32 | # Compiler flags | 41 | # Compiler flags |