error in cmake.bbclass exposed when meta-darwin included
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.
meta/classes/cmake.bbclass +1 -1
@@ -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.
Signature · 3 lines
james woodyatt <[email protected]> Software Architect, New Devices Group