This will add a flag to determine native or cross build
And with this flag this patch will fix build for protobuf and graphdef
message(FATAL_ERROR "'${TARGET_ARCH}' architecture is not supported")
endif()
+# Determine native or cross build
+if("${HOST_ARCH}" STREQUAL "${TARGET_ARCH}")
+ set(BUILD_IS_NATIVE True)
+else()
+ set(BUILD_IS_NATIVE False)
+endif()
+
# TODO add Tizen
# We don't allow cross-os build now
set(HOST_OS "linux")
# Protocol Buffer (>= 3.5.1)
#
# TODO add protobuf for arm cross build
-if(ROOTFS_ARM STREQUAL "")
+if(BUILD_IS_NATIVE AND NOT HOST_ARCH_BASE STREQUAL "arm")
set(protobuf_BUILD_TESTS OFF CACHE BOOL "Build tests" FORCE)
add_subdirectory(protobuf/cmake)