mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-10 12:03:16 +02:00
Fix for build output dir calculation for managed projects
This commit is contained in:
parent
32a9f67aea
commit
68d9181153
3 changed files with 16 additions and 7 deletions
|
@ -2620,25 +2620,30 @@ public class Builder extends BuildObject implements IBuilder, IMatchKeyProvider
|
||||||
|
|
||||||
public ICOutputEntry[] getOutputEntries(){
|
public ICOutputEntry[] getOutputEntries(){
|
||||||
if(isManagedBuildOn()){
|
if(isManagedBuildOn()){
|
||||||
return getDefaultOutputSettings(true);
|
return getDefaultOutputSettings();
|
||||||
}
|
}
|
||||||
ICOutputEntry[] entries = getOutputEntrySettings();
|
ICOutputEntry[] entries = getOutputEntrySettings();
|
||||||
if(entries == null || entries.length == 0){
|
if(entries == null || entries.length == 0){
|
||||||
entries = getDefaultOutputSettings(false);
|
entries = getDefaultOutputSettings();
|
||||||
}
|
}
|
||||||
return entries;
|
return entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ICOutputEntry[] getDefaultOutputSettings(boolean managedBuildOn){
|
private ICOutputEntry[] getDefaultOutputSettings(){
|
||||||
Configuration cfg = (Configuration)getConfguration();
|
Configuration cfg = (Configuration)getConfguration();
|
||||||
if(cfg == null || cfg.isPreference() || cfg.isExtensionElement()){
|
if(cfg == null || cfg.isPreference() || cfg.isExtensionElement()){
|
||||||
return new ICOutputEntry[]{new COutputEntry(Path.EMPTY, null, ICLanguageSettingEntry.VALUE_WORKSPACE_PATH | ICLanguageSettingEntry.RESOLVED)};
|
return new ICOutputEntry[]{new COutputEntry(Path.EMPTY, null, ICLanguageSettingEntry.VALUE_WORKSPACE_PATH | ICLanguageSettingEntry.RESOLVED)};
|
||||||
}
|
}
|
||||||
|
|
||||||
IPath path = cfg.getOwner().getProject().getFullPath();;
|
IPath path = ManagedBuildManager.getBuildFullPath(cfg, this);
|
||||||
if(managedBuildOn){
|
IProject proj = cfg.getOwner().getProject();
|
||||||
path = path.append(cfg.getName());
|
IPath projFullPath = proj.getFullPath();
|
||||||
|
if(projFullPath.isPrefixOf(path)){
|
||||||
|
path = path.removeFirstSegments(projFullPath.segmentCount()).makeRelative();
|
||||||
|
} else {
|
||||||
|
path = Path.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ICOutputEntry[]{new COutputEntry(path, null, ICLanguageSettingEntry.VALUE_WORKSPACE_PATH | ICLanguageSettingEntry.RESOLVED)};
|
return new ICOutputEntry[]{new COutputEntry(path, null, ICLanguageSettingEntry.VALUE_WORKSPACE_PATH | ICLanguageSettingEntry.RESOLVED)};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,12 +32,15 @@ public class CBuildSettingCache extends CDefaultBuildData implements
|
||||||
private ICOutputEntry[] fResolvedOutputEntries;
|
private ICOutputEntry[] fResolvedOutputEntries;
|
||||||
|
|
||||||
CBuildSettingCache(CBuildData base, CConfigurationDescriptionCache cfgCache){
|
CBuildSettingCache(CBuildData base, CConfigurationDescriptionCache cfgCache){
|
||||||
super(base.getId(), base);
|
super(/*base.getId(), base*/);
|
||||||
|
|
||||||
|
fId = base.getId();
|
||||||
|
|
||||||
fCfgCache = cfgCache;
|
fCfgCache = cfgCache;
|
||||||
|
|
||||||
fCfgCache.addBuildSetting(this);
|
fCfgCache.addBuildSetting(this);
|
||||||
|
|
||||||
|
copySettingsFrom(base);
|
||||||
}
|
}
|
||||||
|
|
||||||
void initEnvironmentCache(){
|
void initEnvironmentCache(){
|
||||||
|
|
|
@ -204,6 +204,7 @@ public class CConfigurationDescriptionCache extends CDefaultConfigurationData
|
||||||
|
|
||||||
void addBuildSetting(ICBuildSetting bs){
|
void addBuildSetting(ICBuildSetting bs){
|
||||||
fChildList.add(bs);
|
fChildList.add(bs);
|
||||||
|
fBuildData = (CBuildData)bs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICProjectDescription getProjectDescription() {
|
public ICProjectDescription getProjectDescription() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue