From b34e0d27ab8a9529cbc0df3ade7f9eedca50041f Mon Sep 17 00:00:00 2001 From: Thomas Devoogdt Date: Fri, 16 May 2025 09:05:20 +0200 Subject: [PATCH] package/pkg-cmake.mk: force check_language(CXX) to be false when building w/o C+++ See the code snippet below, which typically is used to check if C++ support can be enabled. If we manually set CMAKE_CXX_COMPILER to /bin/false, then cmake will assume that it's fine, without having a real check. Otherwise, it will do a test run but somehow it falls back to /bin/c++, even when cross-compiling. Fix that by setting CXX to /bin/false. ```cmake include(CheckLanguage) check_language(CXX) if(CMAKE_CXX_COMPILER) enable_language(CXX) endif() ``` Signed-off-by: Thomas Devoogdt Signed-off-by: Peter Korsgaard --- package/pkg-cmake.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk index c7032312fb..ba287d244a 100644 --- a/package/pkg-cmake.mk +++ b/package/pkg-cmake.mk @@ -102,6 +102,7 @@ define $(2)_CONFIGURE_CMDS cd $$($$(PKG)_BUILDDIR) && \ rm -f CMakeCache.txt && \ PATH=$$(BR_PATH) \ + $$(if $$(BR2_INSTALL_LIBSTDCPP),,CXX=/bin/false) \ $$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \ -G$$($$(PKG)_GENERATOR) \ -DCMAKE_MAKE_PROGRAM="$$($$(PKG)_GENERATOR_PROGRAM)" \