summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/cmake.bbclass11
1 files changed, 9 insertions, 2 deletions
diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index d3f0d70847..a5cffedbc6 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -26,14 +26,16 @@ python() {
26 if not d.getVar('OECMAKE_C_COMPILER'): 26 if not d.getVar('OECMAKE_C_COMPILER'):
27 cc_list = d.getVar('CC').split() 27 cc_list = d.getVar('CC').split()
28 if cc_list[0] == 'ccache': 28 if cc_list[0] == 'ccache':
29 d.setVar('OECMAKE_C_COMPILER', '%s %s' % (cc_list[0], cc_list[1])) 29 d.setVar('OECMAKE_C_COMPILER_LAUNCHER', cc_list[0])
30 d.setVar('OECMAKE_C_COMPILER', cc_list[1])
30 else: 31 else:
31 d.setVar('OECMAKE_C_COMPILER', cc_list[0]) 32 d.setVar('OECMAKE_C_COMPILER', cc_list[0])
32 33
33 if not d.getVar('OECMAKE_CXX_COMPILER'): 34 if not d.getVar('OECMAKE_CXX_COMPILER'):
34 cxx_list = d.getVar('CXX').split() 35 cxx_list = d.getVar('CXX').split()
35 if cxx_list[0] == 'ccache': 36 if cxx_list[0] == 'ccache':
36 d.setVar('OECMAKE_CXX_COMPILER', '%s %s' % (cxx_list[0], cxx_list[1])) 37 d.setVar('OECMAKE_CXX_COMPILER_LAUNCHER', cxx_list[0])
38 d.setVar('OECMAKE_CXX_COMPILER', cxx_list[1])
37 else: 39 else:
38 d.setVar('OECMAKE_CXX_COMPILER', cxx_list[0]) 40 d.setVar('OECMAKE_CXX_COMPILER', cxx_list[0])
39} 41}
@@ -49,6 +51,9 @@ OECMAKE_CXX_LINK_FLAGS ?= "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} ${CXXFLAGS} ${LD
49CXXFLAGS += "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}" 51CXXFLAGS += "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}"
50CFLAGS += "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}" 52CFLAGS += "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}"
51 53
54OECMAKE_C_COMPILER_LAUNCHER ?= ""
55OECMAKE_CXX_COMPILER_LAUNCHER ?= ""
56
52OECMAKE_RPATH ?= "" 57OECMAKE_RPATH ?= ""
53OECMAKE_PERLNATIVE_DIR ??= "" 58OECMAKE_PERLNATIVE_DIR ??= ""
54OECMAKE_EXTRA_ROOT_PATH ?= "" 59OECMAKE_EXTRA_ROOT_PATH ?= ""
@@ -86,6 +91,8 @@ set( CMAKE_SYSTEM_NAME `echo ${TARGET_OS} | sed -e 's/^./\u&/' -e 's/^\(Linux\).
86set( CMAKE_SYSTEM_PROCESSOR ${@map_target_arch_to_uname_arch(d.getVar('TARGET_ARCH'))} ) 91set( CMAKE_SYSTEM_PROCESSOR ${@map_target_arch_to_uname_arch(d.getVar('TARGET_ARCH'))} )
87set( CMAKE_C_COMPILER ${OECMAKE_C_COMPILER} ) 92set( CMAKE_C_COMPILER ${OECMAKE_C_COMPILER} )
88set( CMAKE_CXX_COMPILER ${OECMAKE_CXX_COMPILER} ) 93set( CMAKE_CXX_COMPILER ${OECMAKE_CXX_COMPILER} )
94set( CMAKE_C_COMPILER_LAUNCHER ${OECMAKE_C_COMPILER_LAUNCHER} )
95set( CMAKE_CXX_COMPILER_LAUNCHER ${OECMAKE_CXX_COMPILER_LAUNCHER} )
89set( CMAKE_ASM_COMPILER ${OECMAKE_C_COMPILER} ) 96set( CMAKE_ASM_COMPILER ${OECMAKE_C_COMPILER} )
90set( CMAKE_AR ${OECMAKE_AR} CACHE FILEPATH "Archiver" ) 97set( CMAKE_AR ${OECMAKE_AR} CACHE FILEPATH "Archiver" )
91set( CMAKE_C_FLAGS "${OECMAKE_C_FLAGS}" CACHE STRING "CFLAGS" ) 98set( CMAKE_C_FLAGS "${OECMAKE_C_FLAGS}" CACHE STRING "CFLAGS" )