summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle Russell <bkylerussell@gmail.com>2017-04-18 11:36:05 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-19 10:18:43 +0100
commit3b3aab0e8d2937505a15d273f3620a5c5c09165c (patch)
treefdccfe2c61dde95518a71c7ad7c0f7a3ce5a8298
parentae5d6431145b62aca79db7e3d7854d30a74e2311 (diff)
downloadpoky-3b3aab0e8d2937505a15d273f3620a5c5c09165c.tar.gz
cmake.bbclass: Set CMAKE_CROSSCOMPILING correctly
If CMAKE_SYSTEM_NAME is defined, CMake assumes we're cross-compiling, which is not necessarily the case. (From OE-Core rev: bd082c9be6191e67ea1b1bf10ce5e130a3433ab5) Signed-off-by: Kyle Russell <bkylerussell@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/cmake.bbclass4
1 files changed, 4 insertions, 0 deletions
diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index 9e74599296..3f670919a8 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -42,9 +42,13 @@ def map_target_arch_to_uname_arch(target_arch):
42 return target_arch 42 return target_arch
43 43
44cmake_do_generate_toolchain_file() { 44cmake_do_generate_toolchain_file() {
45 if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then
46 CMAKE_CROSSCOMPILING="set( CMAKE_CROSSCOMPILING FALSE )"
47 fi
45 cat > ${WORKDIR}/toolchain.cmake <<EOF 48 cat > ${WORKDIR}/toolchain.cmake <<EOF
46# CMake system name must be something like "Linux". 49# CMake system name must be something like "Linux".
47# This is important for cross-compiling. 50# This is important for cross-compiling.
51${CMAKE_CROSSCOMPILING}
48set( CMAKE_SYSTEM_NAME `echo ${TARGET_OS} | sed -e 's/^./\u&/' -e 's/^\(Linux\).*/\1/'` ) 52set( CMAKE_SYSTEM_NAME `echo ${TARGET_OS} | sed -e 's/^./\u&/' -e 's/^\(Linux\).*/\1/'` )
49set( CMAKE_SYSTEM_PROCESSOR ${@map_target_arch_to_uname_arch(d.getVar('TARGET_ARCH'))} ) 53set( CMAKE_SYSTEM_PROCESSOR ${@map_target_arch_to_uname_arch(d.getVar('TARGET_ARCH'))} )
50set( CMAKE_C_COMPILER ${OECMAKE_C_COMPILER} ) 54set( CMAKE_C_COMPILER ${OECMAKE_C_COMPILER} )