Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318331 - Adding a define at the top-level doesn't correctly rebuild sources where compiler tool has other overriden options
Summary: Adding a define at the top-level doesn't correctly rebuild sources where comp...
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build-managed (show other bugs)
Version: 7.0   Edit
Hardware: PC All
: P3 major (vote)
Target Milestone: 7.0.1   Edit
Assignee: James Blackburn CLA
QA Contact: Chris Recoskie CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-29 10:13 EDT by James Blackburn CLA
Modified: 2010-06-29 12:23 EDT (History)
0 users

See Also:


Attachments
fix 1 (963 bytes, patch)
2010-06-29 11:51 EDT, James Blackburn CLA
jamesblackburn+eclipse: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.