/* * Copyright (c) 2008 Embedded Brains GmbH and others. * * Embedded Brains GmbH * Obere Lagerstr. 30 * D-82178 Puchheim * Germany * rtems@embedded-brains.de * * All rights reserved. This program and the accompanying materials are made * available under the terms of the Eclipse Public License Version 1.0 ("EPL") * which accompanies this distribution and is available at * * http://www.eclipse.org/legal/epl-v10.html * * For purposes of the EPL, "Program" will mean the Content. * * Contributors: * * Sebastian Huber (Embedded Brains GmbH) - Initial API and implementation. */ package org.rtems.cdt.build; import org.eclipse.cdt.make.internal.core.scannerconfig2.GCCSpecsRunSIProvider; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.Path; import org.rtems.cdt.Constants; import org.rtems.cdt.Storage; public class RunScannerInfoProvider extends GCCSpecsRunSIProvider { protected String getPlatform() { return Constants.PLATFORM_DEFAULT; } protected boolean initialize() { if (!super.initialize()) { return false; } IProject project = resource.getProject(); /* * FIXME: This is a hack to avoid to early discovery of internal * compiler include paths and symbols. The discovery is suppressed for * empty projects which contain only the '.project' and '.cproject' * files. */ try { if (project.members().length < 3) { return false; } } catch (CoreException e) { e.printStackTrace(); return false; } // Change platform Storage.changePlatform( project, getPlatform()); // Set compile command fCompileCommand = new Path( Storage.getProperty( project, Constants.TOOL_COMPILER_C_KEY) ); // Add the standard options to the command arguments String options [] = Storage.getToolOptions( project, Constants.TOOL_COMPILER_C_KEY); String newCompileArguments [] = new String [options.length + fCompileArguments.length]; System.arraycopy( options, 0, newCompileArguments, 0, options.length); System.arraycopy( fCompileArguments, 0, newCompileArguments, options.length, fCompileArguments.length); fCompileArguments = newCompileArguments; return true; } }