[openwrt/openwrt] cmake.mk: set C/CXX compiler for host builds as well

LEDE Commits lede-commits at lists.infradead.org
Sat Dec 5 14:50:37 EST 2020


ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-19.07:
https://git.openwrt.org/77734ce82a8fdc88b88cb1244d6e2f54eeb773b0

commit 77734ce82a8fdc88b88cb1244d6e2f54eeb773b0
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Wed Nov 25 16:08:57 2020 -0800

    cmake.mk: set C/CXX compiler for host builds as well
    
    Without this, cmake will use whatever CC/CXX is set to, which could be
    clang. In that case, at least libjson-c/host will fail to compile.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    (cherry picked from commit f98878e4c17d5f11e78994b4fc456e6b60b2660f)
---
 include/cmake.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/cmake.mk b/include/cmake.mk
index a5ba7d31bf..1f764ab955 100644
--- a/include/cmake.mk
+++ b/include/cmake.mk
@@ -90,6 +90,8 @@ define Host/Configure/Default
 		LDFLAGS="$(HOST_LDFLAGS)" \
 		cmake \
 			-DCMAKE_BUILD_TYPE=Release \
+			-DCMAKE_C_COMPILER="$(HOSTCC)" \
+			-DCMAKE_CXX_COMPILER="$(HOSTCXX)" \
 			-DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
 			-DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
 			-DCMAKE_EXE_LINKER_FLAGS:STRING="$(HOST_LDFLAGS)" \



More information about the lede-commits mailing list