Added support for the -Wextra cli parameter
This commit is contained in:
parent
53df02fa71
commit
fbaa0264e1
3 changed files with 37 additions and 5 deletions
|
@ -60,6 +60,7 @@ public class CompileOptions {
|
|||
private boolean progressive_;
|
||||
private boolean verbose_;
|
||||
private boolean wError_;
|
||||
private boolean wExtra_;
|
||||
|
||||
/**
|
||||
* Specify advanced compiler options.
|
||||
|
@ -374,11 +375,16 @@ public class CompileOptions {
|
|||
args.add("-verbose");
|
||||
}
|
||||
|
||||
// Werror
|
||||
// Wwrror
|
||||
if (wError_) {
|
||||
args.add("-Werror");
|
||||
}
|
||||
|
||||
// Wextra
|
||||
if (wExtra_) {
|
||||
args.add("-Wextra");
|
||||
}
|
||||
|
||||
// advanced option (X)
|
||||
if (!advancedOptions_.isEmpty()) {
|
||||
advancedOptions_.forEach(it -> args.add("-X" + it));
|
||||
|
@ -597,6 +603,15 @@ public class CompileOptions {
|
|||
return wError_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether additional declaration, expression, and type compiler checks emit warnings.
|
||||
*
|
||||
* @return {@code true} or {@code false}
|
||||
*/
|
||||
public boolean isWExtra() {
|
||||
return wExtra_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate metadata for Java 1.8 reflection on method parameters.
|
||||
*
|
||||
|
@ -1071,4 +1086,15 @@ public class CompileOptions {
|
|||
wError_ = wError;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable additional declaration, expression, and type compiler checks that emit warnings if {@code true}.
|
||||
*
|
||||
* @param wExtra {@code true} or {@code false}
|
||||
* @return this operation instance
|
||||
*/
|
||||
public CompileOptions wExtra(boolean wExtra) {
|
||||
wExtra_ = wExtra;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue