Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 318331

Summary: Adding a define at the top-level doesn't correctly rebuild sources where compiler tool has other overriden options
Product: [Tools] CDT Reporter: James Blackburn <jamesblackburn+eclipse>
Component: cdt-build-managedAssignee: James Blackburn <jamesblackburn+eclipse>
Status: RESOLVED FIXED QA Contact: Chris Recoskie <recoskie>
Severity: major    
Priority: P3    
Version: 7.0   
Target Milestone: 7.0.1   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
fix 1 jamesblackburn+eclipse: iplog-

Description James Blackburn CLA 2010-06-29 10:13:58 EDT
Steps to reproduce
1) Create helloworld C project
2) Override a (non-preprocessor define) option on the source folder src
   e.g. Change optimization to -O2.
3) Build the project
4) Add a define to project top-level
5) Build again

At stage 5, the source file isn't correctly rebuilt. Note the makefiles are correct and up to date, CDT just hasn't pruned the the out of date derived files.
Comment 1 James Blackburn CLA 2010-06-29 11:51:20 EDT
Created attachment 173019 [details]
fix 1

As tools inherit (non-overriden) options from their superClass. #needsRebuild should query the superClass as well.

This bug looks applicable to all HoldsOption types (both Tool and ToolChain) so I think the fix should go in the abstract base class.
Comment 2 James Blackburn CLA 2010-06-29 11:56:02 EDT
Fix committed to 7.0.1 + HEAD.