Skip to content

Commit

Permalink
expand variable in 'Other CMake arguments' setting
Browse files Browse the repository at this point in the history
Fix #207
  • Loading branch information
15knots committed Feb 11, 2025
1 parent 68225a7 commit 2050d0b
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -563,10 +563,16 @@ private List<String> buildCommandline(IPath srcDir, Optional<BuildToolKitDefinit
/* user specified other cmake arguments.. */
String otherArguments = prefs.getOtherArguments();
if (otherArguments != null) {
final ICdtVariableManager mngr = CCorePlugin.getDefault().getCdtVariableManager();
// handle Unix shell quoting
QuotedStringTokenizer tokenizer = QuotedStringTokenizer.builder().delimiters( " \t\n\r\f").build();
QuotedStringTokenizer tokenizer = QuotedStringTokenizer.builder().delimiters(" \t\n\r\f").build();
for (Iterator<String> iter = tokenizer.tokenize(otherArguments); iter.hasNext();) {
args.add(iter.next());
final String arg = iter.next();
try {
args.add(mngr.resolveValue(arg, null, "", cfgd));
} catch (CdtVariableException ex) {
args.add(arg);
}
}
}
}
Expand Down

0 comments on commit 2050d0b

Please sign in to comment.