Do not guess build mode (native/cross) (#4607)
author박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Thu, 7 Mar 2019 00:55:12 +0000 (09:55 +0900)
committer박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Thu, 7 Mar 2019 00:55:12 +0000 (09:55 +0900)
This commit updates identify_platform.cmake to use configuration
variable that user provides.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
Makefile
cmake/option/identify_platform.cmake

index caf4ea0..72789a1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -34,6 +34,7 @@ endif
 ifeq ($(CROSS_BUILD),1)
        TOOLCHAIN_FILE=cmake/config/config_$(TARGET_ARCH_LC)-$(TARGET_OS).cmake
        OPTION_TOOLCHAIN=-DCMAKE_TOOLCHAIN_FILE=$(TOOLCHAIN_FILE)
+       OPTIONS+= -DCROSS_BUILD=ON
 else
        OPTION_TOOLCHAIN=
 endif
index 4702304..66e0255 100644 (file)
@@ -40,8 +40,7 @@ else()
   message(FATAL_ERROR "'${TARGET_ARCH}' architecture is not supported")
 endif()
 
-# Determine native or cross build
-if("${HOST_ARCH}" STREQUAL "${TARGET_ARCH}")
+if(NOT CROSS_BUILD)
   set(BUILD_IS_NATIVE True)
 else()
   set(BUILD_IS_NATIVE False)