Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] fix for 70491

This patch fixes the problem whereby source files which are linked from elsewhere in the file system will not be built.

 

IMO this should be included in 2.0.1.  The patch is pretty simple and is low-risk.

 

___________________________________________

 

Chris Recoskie

Software Designer

IDE Frameworks Group

Texas Instruments, Toronto

 

 

 

cvs server: Diffing .
cvs server: Diffing schema
cvs server: Diffing src
cvs server: Diffing src/org
cvs server: Diffing src/org/eclipse
cvs server: Diffing src/org/eclipse/cdt
cvs server: Diffing src/org/eclipse/cdt/managedbuilder
cvs server: Diffing src/org/eclipse/cdt/managedbuilder/core
cvs server: Diffing src/org/eclipse/cdt/managedbuilder/internal
cvs server: Diffing src/org/eclipse/cdt/managedbuilder/internal/core
cvs server: Diffing src/org/eclipse/cdt/managedbuilder/internal/scannerconfig
cvs server: Diffing src/org/eclipse/cdt/managedbuilder/makegen
cvs server: Diffing src/org/eclipse/cdt/managedbuilder/makegen/gnu
Index: src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java,v
retrieving revision 1.19.2.1
diff -r1.19.2.1 GnuMakefileGenerator.java
328a329,364
> 		// fix for PR 70491
> 		IPath resourceLocation = resource.getLocation();
> 		String projectLocation = project.getLocation().toString();
> 
> 		String resourcePath = null;
> 		String buildRule = null;
> 		
> 		// figure out path to use to resource
> 		/**
> 		 * 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.
> 		 */
> 		if(!resourceLocation.toString().startsWith(projectLocation))
> 		{
> 			// it IS linked, so use the actual location
> 			resourcePath = resourceLocation.toString();
> 			// Add the rule and command to the makefile
> 			
> 			// 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
> 			resourcePath = relativePath; // not really needed to store per se but in the future someone may want this
> 			
> 			// Add the rule and command to the makefile
> 			buildRule = relativePath + WILDCARD + DOT + outputExtension + COLON + WHITESPACE + ROOT + SEPARATOR + resourcePath + WILDCARD + DOT + inputExtension;
> 		}
> 		// end fix for PR 70491
> 		
335,336c371
< 		// Add the rule and command to the makefile
< 		String buildRule = relativePath + WILDCARD + DOT + outputExtension + COLON + WHITESPACE + ROOT + SEPARATOR + relativePath + WILDCARD + DOT + inputExtension;
---
> 
cvs server: Diffing src/org/eclipse/cdt/managedbuilder/makegen/internal
cvs server: Diffing src/org/eclipse/cdt/managedbuilder/scannerconfig

Back to the top