From 34bbc53cf4601e8568a01b87e4aa9ded224d647d Mon Sep 17 00:00:00 2001 From: Marta Navarro Date: Thu, 17 Mar 2022 18:32:02 +0100 Subject: [PATCH] build: fix getting cmake_cxx_compiler from cache CMakeCache.txt is showing CMAKE_CXX_COMPILER as a STRING instead of FILEPATH. When plugin retrieves cache information, it is failing to recover CMAKE_CXX_COMPILER, and triggering and execution during build. Searching for STRING if FILEPATH is not found solves the issue. Signed-off-by: Marta Navarro --- .../ide/eclipse/core/internal/build/CMakeCache.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/org.zephyrproject.ide.eclipse.core/src/org/zephyrproject/ide/eclipse/core/internal/build/CMakeCache.java b/plugins/org.zephyrproject.ide.eclipse.core/src/org/zephyrproject/ide/eclipse/core/internal/build/CMakeCache.java index a68b638..d2c4440 100644 --- a/plugins/org.zephyrproject.ide.eclipse.core/src/org/zephyrproject/ide/eclipse/core/internal/build/CMakeCache.java +++ b/plugins/org.zephyrproject.ide.eclipse.core/src/org/zephyrproject/ide/eclipse/core/internal/build/CMakeCache.java @@ -112,7 +112,14 @@ public String getCCompiler() { * @return Path to C++ compiler as discovered by CMake */ public String getCXXCompiler() { - return getFilePath(CMAKE_CXX_COMPILER); + /* CMAKE_CXX_COMPILER can appear as FILEPATH or STRING */ + String cxx_compiler = getFilePath(CMAKE_CXX_COMPILER); + + if (cxx_compiler == null) { + cxx_compiler = getString(CMAKE_CXX_COMPILER); + } + + return cxx_compiler; } /**