From b13d29ebb2b35ca2478ec72d3fb89a4a4b397f83 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Fri, 18 Apr 2025 18:11:17 +0200 Subject: [PATCH] tests: scripts: fix test_cmake_out_of_source By default C++ code would be compiled with GNU while C with Clang and this can create problems at link time. In order to prevent this we use Clang for both. Signed-off-by: Valerio Setti --- tests/scripts/components-build-system.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/scripts/components-build-system.sh b/tests/scripts/components-build-system.sh index 3108aa7b92..e533cdf0f9 100644 --- a/tests/scripts/components-build-system.sh +++ b/tests/scripts/components-build-system.sh @@ -65,7 +65,9 @@ component_test_cmake_out_of_source () { mkdir "$OUT_OF_SOURCE_DIR" cd "$OUT_OF_SOURCE_DIR" # Note: Explicitly generate files as these are turned off in releases - cmake -D CMAKE_BUILD_TYPE:String=Check -D GEN_FILES=ON -D TEST_CPP=1 "$MBEDTLS_ROOT_DIR" + # Note: Use Clang compiler also for C++ (C uses it by default) + CXX=clang++ cmake -D CMAKE_BUILD_TYPE:String=Check -D GEN_FILES=ON \ + -D TEST_CPP=1 "$MBEDTLS_ROOT_DIR" make msg "test: cmake 'out-of-source' build"