Skip to content

Commit

Permalink
build: fix getting cmake_c_compiler from cache
Browse files Browse the repository at this point in the history
CMakeCache.txt is showing CMAKE_C_COMPILER as a STRING instead of
FILEPATH the first time that we build from plugin. When plugin retrieves
cache information, it is failing to recover CMAKE_C_COMPILER, and
triggering an exception during build. Searching for STRING if FILEPATH
is not found solves the issue.

Signed-off-by: Marta Navarro <marta.navarro@intel.com>
  • Loading branch information
martanav authored and dcpleung committed Mar 29, 2022
1 parent 34bbc53 commit 2eec01f
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,14 @@ public String getInternal(String name) {
* @return Path to C compiler as discovered by CMake
*/
public String getCCompiler() {
return getFilePath(CMAKE_C_COMPILER);
/* CMAKE_C_COMPILER can appear as FILEPATH or STRING */
String c_compiler = getFilePath(CMAKE_C_COMPILER);

if (c_compiler == null) {
c_compiler = getString(CMAKE_C_COMPILER);
}

return c_compiler;
}

/**
Expand Down

0 comments on commit 2eec01f

Please sign in to comment.