[yocto] error in cmake.bbclass exposed when meta-darwin included

Woodyatt, James james.woodyatt at intel.com
Tue Dec 31 12:50:40 PST 2013


Everyone‹

Please review the following patch for Poky, which I believe is necessary
for properly supporting builds where meta-darwin (also probably
meta-mingw) is included in the Bitbake layer path list.

Explanation: the meta-darwin layer overrides the value of the SDK_OS
variable with the value of HOST_OS, which is ³darwin² for most builds, and
this makes everything that uses CMake fail to build properly.  The case
where I found this is when OpenCV is included from the OpenEmbedded
meta-oe layer.  The patch below seems to correct an error in the usage of
the SDK_OS variable within the cmake.bbclass file.

diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index e64c30c..4ef9fca 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -35,7 +35,7 @@ cmake_do_generate_toolchain_file() {
        cat > ${WORKDIR}/toolchain.cmake <<EOF
 # CMake system name must be something like "Linux".
 # This is important for cross-compiling.
-set( CMAKE_SYSTEM_NAME `echo ${SDK_OS} | sed 's/^./\u&/'` )
+set( CMAKE_SYSTEM_NAME `echo ${TARGET_OS} | sed 's/^./\u&/'` )
 set( CMAKE_SYSTEM_PROCESSOR ${TARGET_ARCH} )
 set( CMAKE_C_COMPILER ${OECMAKE_C_COMPILER} )
 set( CMAKE_CXX_COMPILER ${OECMAKE_CXX_COMPILER} )

I tested this with a local build, and I believe this diff should be
appended to the oecore.patch file in the meta-darwin layer source tree,
and it should be applied in the appropriate branches of the Poky source
tree.


-- 
james woodyatt <james.woodyatt at intel.com>

Software Architect, New Devices Group




More information about the yocto mailing list