From 29217932c34d7e3368764ab64879dc6f1edab1a6 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 14 Jan 2019 11:19:44 -0800
Subject: [PATCH] Use host compiler to compile native tools

Helps in cross compiling

Upstream-Status: Inappropriate [OE-Specific]

Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 CMakeLists.txt | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1085,11 +1085,10 @@ ELSE()
     SET(BIN2H_COMMAND  "${NATIVE_BIN_DIR}/bin2h")
     SET(BSINCGEN_COMMAND  "${NATIVE_BIN_DIR}/bsincgen")
     ADD_CUSTOM_COMMAND(OUTPUT "${BIN2H_COMMAND}" "${BSINCGEN_COMMAND}"
-        COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" "${NATIVE_SRC_DIR}"
         COMMAND ${CMAKE_COMMAND} -E remove "${BIN2H_COMMAND}" "${BSINCGEN_COMMAND}"
-        COMMAND ${CMAKE_COMMAND} --build . --config "Release"
+        COMMAND gcc "${NATIVE_SRC_DIR}/bin2h.c" -o "${BIN2H_COMMAND}" -lm
+        COMMAND gcc "${NATIVE_SRC_DIR}/bsincgen.c" -o "${BSINCGEN_COMMAND}" -lm
         WORKING_DIRECTORY "${NATIVE_BIN_DIR}"
-        DEPENDS "${NATIVE_SRC_DIR}/CMakeLists.txt"
         IMPLICIT_DEPENDS
             C "${NATIVE_SRC_DIR}/bin2h.c"
             C "${NATIVE_SRC_DIR}/bsincgen.c"
