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

Bug 345194

Summary: Referenced projects are unnecessarily built multiple times
Product: [Tools] CDT Reporter: Baltasar Belyavsky <bbelyavsky>
Component: cdt-buildAssignee: cdt-build-inbox <cdt-build-inbox>
Status: RESOLVED DUPLICATE QA Contact: Andrew Gvozdev <angvoz.dev>
Severity: major    
Priority: P3 CC: cdtdoug, jamesblackburn+eclipse, marcin.swiezawski
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Baltasar Belyavsky CLA 2011-05-09 15:58:56 EDT
Build Identifier: I20110428-0848 [Indigo M7]

This is probably a CDT-core problem, but it manifests itself during the build - if you have two projects, one referencing the other, if the active build-configuration in the referenced project is different than the one referenced from the main project, then building the main project causes the referenced project to always build twice. This can be really bad for users who have large projects which take long to build.

The cause seems to be the fact that adding a build-configuration reference (using the C/C++ General > Paths and Symbols > References tab) also adds a plain Platform project reference (Project References page).  The plain Platform project reference causes the active build-configuration in the referenced project to always build, even if it's not necessary.

Reproducible: Always

Steps to Reproduce:
1. Create two simple projects, a and b.
2. Add a build-configuration reference from a/Release to b/Release (using the C/C++ General > Paths and Symbols > References tab). Notice that a plain project reference is also added (Project References page).
3. Set the active build-configuration on project a to Release, while keeping project b at Debug.
4. Build project a.
-> The observed behaviour is that 3 builds are performed - b/Debug, b/Release, a/Release. The first build, b/Debug, should not happen.

If the plain project-reference is manually removed (through the Project References page), then the build works as expected.
Comment 1 James Blackburn CLA 2011-05-09 16:15:41 EDT
(In reply to comment #0)
> If the plain project-reference is manually removed (through the Project
> References page), then the build works as expected.

True. The problem is that other platform builders aren't run correctly.  This will be fixed when CDT starts using platform build configurations.

See also bug 309769 and bug 331031

*** This bug has been marked as a duplicate of bug 317402 ***