summaryrefslogtreecommitdiffstats
path: root/meta/classes/cmake.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/cmake.bbclass')
-rw-r--r--meta/classes/cmake.bbclass21
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}"
4DEPENDS_prepend = "cmake-native " 4DEPENDS_prepend = "cmake-native "
5B = "${WORKDIR}/build" 5B = "${WORKDIR}/build"
6 6
7# We need to unset CCACHE otherwise cmake gets too confused
8CCACHE = ""
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".
12OECMAKE_GENERATOR ?= "Ninja" 9OECMAKE_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)
28OECMAKE_C_COMPILER ?= "`echo ${CC} | sed 's/^\([^ ]*\).*/\1/'`"
29OECMAKE_CXX_COMPILER ?= "`echo ${CXX} | sed 's/^\([^ ]*\).*/\1/'`"
30OECMAKE_AR ?= "${AR}" 39OECMAKE_AR ?= "${AR}"
31 40
32# Compiler flags 41# Compiler flags