Modifier des options de compilation programmatiquement
Bonjour,
Lors de la création d'un nouveau project C ou C++ d'une toolchain particilière, je voudrais ajouter programmatiquement des options.
Pour cela je fais :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(proj);
IConfiguration[] cc = info.getManagedProject().getConfigurations();
for (IConfiguration c : cc) {
ITool[] tool = c.getTools();
for (ITool t : tool) {
IOption[] opt = t.getOptions();
for (IOption o : opt) {
if(o.getBaseId().equalsIgnoreCase("pouet.include")){
try {
String[] val = o.getBasicStringListValue();
String[] valAdd = new String[val.length+1];
valAdd[val.length] = "\"${POUET):/include}\"";
o.setValue(valAdd);
} catch (BuildException e) {
e.printStackTrace();
}
}
if(o.getBaseId().equalsIgnoreCase("macro.def")){
try {
String[] val = o.getBasicStringListValue();
String[] valAdd = new String[val.length+1];
valAdd[val.length] = "POUET=16";
o.setValue(valAdd);
} catch (BuildException e) {
e.printStackTrace();
}
}
}
}
} |
A la fin de la création de mon projet, si j'ouvre les C/C++ build settings, je vois bien mes options avec les valeurs que j'ai ajoutées.
Sauf que quand je quitte mon IDE et que je le relance mes options n'ont pas été enregistrées !
Que dois-je faire ?
Si vous avez des idées ???
Merci d'avance