Skip to content

Commit

Permalink
Only register ClangPlugin if clad is found
Browse files Browse the repository at this point in the history
  • Loading branch information
hahnjo authored and vgvassilev committed May 16, 2024
1 parent c4ac006 commit eda1420
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tools/ClangPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ namespace clad {
break;
}

// Register clad as a backend pass.
CodeGenOptions& CGOpts = CI.getCodeGenOpts();
CGOpts.PassPlugins.push_back(CladSoPath.str());
if (!CladSoPath.empty()) {
// Register clad as a backend pass.
CodeGenOptions& CGOpts = CI.getCodeGenOpts();
CGOpts.PassPlugins.push_back(CladSoPath.str());
}
#endif // CLANG_VERSION_MAJOR > 8
}

Expand Down

0 comments on commit eda1420

Please sign in to comment.