Skip to content

Commit

Permalink
build: fix getting cmake_cxx_compiler from cache
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
martanav authored and dcpleung committed Mar 17, 2022
1 parent 17572aa commit 34bbc53
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 34bbc53

Please sign in to comment.