mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 08:55:25 +02:00
Bug 580286: Accommodate extra flags with internal builder (#31)
This commit is contained in:
parent
9695d54244
commit
a9c3819565
3 changed files with 14 additions and 16 deletions
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006, 2014 Intel Corporation and others.
|
||||
* Copyright (c) 2006, 2022 Intel Corporation and others.
|
||||
*
|
||||
* This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License 2.0
|
||||
|
@ -10,6 +10,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Intel Corporation - Initial API and implementation
|
||||
* John Dallaway - Accommodate extra flags with internal builder (bug 580286)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.core.tests;
|
||||
|
||||
|
@ -1652,13 +1653,6 @@ public class BuildDescriptionModelTests extends TestCase {
|
|||
type.addResource(tDes.createResource("dir2/h.r"));
|
||||
type.addResource(tDes.createResource("dir2/i.r"));
|
||||
|
||||
type = step.createIOType(false, false, null);
|
||||
type.addResource(tDes.createResource("o1.o"));
|
||||
type.addResource(tDes.createResource("dir3/o2.o"));
|
||||
type.addResource(tDes.createResource("dir4/d/o3.o"));
|
||||
|
||||
//
|
||||
//
|
||||
step = tDes.createStep(null, null);
|
||||
|
||||
type = step.createIOType(true, false, null);
|
||||
|
@ -1755,11 +1749,6 @@ public class BuildDescriptionModelTests extends TestCase {
|
|||
// type.addResource(tDes.createResource(cName + "/t.o"));
|
||||
// type.addResource(tDes.createResource(cName + "/y.o"));
|
||||
|
||||
// type = step.createIOType(true, false, null);
|
||||
type.addResource(tDes.createResource("o1.o"));
|
||||
type.addResource(tDes.createResource("dir3/o2.o"));
|
||||
type.addResource(tDes.createResource("dir4/d/o3.o"));
|
||||
|
||||
type = step.createIOType(false, false, null);
|
||||
type.addResource(tDes.createResource(cName + "/" + artifactName));
|
||||
//
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006, 2016 Intel Corporation and others.
|
||||
* Copyright (c) 2006, 2022 Intel Corporation and others.
|
||||
*
|
||||
* This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License 2.0
|
||||
|
@ -12,6 +12,7 @@
|
|||
* Intel Corporation - Initial API and implementation
|
||||
* IBM Corporation
|
||||
* John Dallaway - Handle reduced build step input resource count (bug 366039)
|
||||
* John Dallaway - Accommodate extra flags with internal builder (bug 580286)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.internal.buildmodel;
|
||||
|
||||
|
@ -1523,6 +1524,7 @@ public class BuildDescription implements IBuildDescription {
|
|||
* 3. Use the file extensions and the resources in the project
|
||||
*/
|
||||
ITool tool = step.getTool();
|
||||
boolean toolHasExtraFlags = tool.getCommandLinePattern().contains("${EXTRA_FLAGS}"); //$NON-NLS-1$
|
||||
IInputType[] inTypes = tool.getInputTypes();
|
||||
if (inTypes != null && inTypes.length > 0) {
|
||||
for (IInputType type : inTypes) {
|
||||
|
@ -1597,7 +1599,8 @@ public class BuildDescription implements IBuildDescription {
|
|||
if ((var = var.trim()).length() != 0) {
|
||||
if (VAR_USER_OBJS.equals(var)) {
|
||||
String objs[] = getUserObjs(step);
|
||||
if (objs != null && objs.length != 0) {
|
||||
// if there are user objects and they will not be provided as extra flags
|
||||
if ((!toolHasExtraFlags) && (objs != null) && (objs.length != 0)) {
|
||||
if (arg == null)
|
||||
arg = step.createIOType(true, primaryInput, type);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006, 2016 Intel Corporation and others.
|
||||
* Copyright (c) 2006, 2022 Intel Corporation and others.
|
||||
*
|
||||
* This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License 2.0
|
||||
|
@ -10,6 +10,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Intel Corporation - Initial API and implementation
|
||||
* John Dallaway - Accommodate extra flags with internal builder (bug 580286)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.internal.buildmodel;
|
||||
|
||||
|
@ -358,6 +359,11 @@ public class BuildStep implements IBuildStep {
|
|||
private String[] getInputResources(IPath cwd, BuildResource[] rcs) {
|
||||
String[] resources = resourcesToStrings(cwd, rcs, null);
|
||||
|
||||
// if the libraries will be provided as extra flags we do not need to add them here
|
||||
if (fTool.getCommandLinePattern().contains("${EXTRA_FLAGS}")) { //$NON_NLS-1$
|
||||
return resources;
|
||||
}
|
||||
|
||||
// also need to get libraries
|
||||
String[] libs = null;
|
||||
IOption[] opts = fTool.getOptions();
|
||||
|
|
Loading…
Add table
Reference in a new issue