mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-12 03:25:22 +02:00
Fix for bugzilla 70491 -- Unable to build source files in a linked directory
This commit is contained in:
parent
5a650d1e6e
commit
af2454ec98
1 changed files with 26 additions and 2 deletions
|
@ -332,8 +332,32 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
||||||
getDependencyMakefiles().add(depFile);
|
getDependencyMakefiles().add(depFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the rule and command to the makefile
|
/*
|
||||||
String buildRule = relativePath + WILDCARD + DOT + outputExtension + COLON + WHITESPACE + ROOT + SEPARATOR + relativePath + WILDCARD + DOT + inputExtension;
|
* fix for PR 70491
|
||||||
|
* We need to check if the current resource is LINKED, because
|
||||||
|
* the default CDT doesn't handle this properly. If it IS linked,
|
||||||
|
* then we must get the actual location of the resource, rather
|
||||||
|
* than the relative path.
|
||||||
|
*/
|
||||||
|
IPath resourceLocation = resource.getLocation();
|
||||||
|
String projectLocation = project.getLocation().toString();
|
||||||
|
String resourcePath = null;
|
||||||
|
String buildRule = null;
|
||||||
|
// figure out path to use to resource
|
||||||
|
if(!resourceLocation.toString().startsWith(projectLocation)) {
|
||||||
|
// it IS linked, so use the actual location
|
||||||
|
resourcePath = resourceLocation.toString();
|
||||||
|
// Need a hardcoded rule, not a pattern rule, as a linked file
|
||||||
|
// can reside in any path
|
||||||
|
buildRule = relativePath + resourceName + DOT + outputExtension + COLON + WHITESPACE + resourcePath;
|
||||||
|
} else {
|
||||||
|
// use the relative path (not really needed to store per se but in the future someone may want this)
|
||||||
|
resourcePath = relativePath;
|
||||||
|
// The rule and command to add to the makefile
|
||||||
|
buildRule = relativePath + WILDCARD + DOT + outputExtension + COLON + WHITESPACE + ROOT + SEPARATOR + resourcePath + WILDCARD + DOT + inputExtension;
|
||||||
|
} // end fix for PR 70491
|
||||||
|
|
||||||
|
// No duplicates in a makefile
|
||||||
if (getRuleList().contains(buildRule)) {
|
if (getRuleList().contains(buildRule)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue