diff options
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 |