Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Macros set in external settings provider not visible.
  • From: "Waterlander, Erwin" <erwin.waterlander@xxxxxxxxx>
  • Date: Fri, 17 Jul 2020 12:47:02 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gHFy/gfR0ocJlnc1rOoAD4MxoFPIA687Co+xY6u1izo=; b=SlHaDgVgM7dfgAkiRFThNSqYPtTulNI78UctPh5ca8Rp8pd/BoNw9ztKVaXHdMI3UNN16tKNJhBGomHi4HjoFg0V6bHgtoT8bnaMpBHWyY7TIFdeDo/RNWB8UI2IqCCIgPd2ducZkkwgMwNYupTKTghnN3UAqR8I9/jae7vrESRnWOECCvklH+lHzJfUdA3gFQuxv/nuGjVDaEMa4j6Iw1wCN8dUgT3GJThkcMswwSePQOYuG+r9rhD4MVvEM1ka/rDzR1y3dtUBg9uX4RQkUac85ZLy8eeD5wvfkEglsnQ0SeaTyMlziqN++QmccJO/zyI74ZKQ2kfs9asAPau3rg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BvJ+fTrRZTximiWAFAwaaLUJNmXhfLZqWH8bwtqws5k4BeDHYgCs2mGAoeNdo8iK0z5GicNq9EJtHZtX+4a5qorUXXHq3Q6aHFAAn+33npu6DuIyG4F2nU26G/jkxfza7Guh1oLydIRRpc69B45nb934tNOVYS2zBBZ/+VzbML/R+7K+sKqMhT+LXYZ5gREwYYxlHgoJmni6ZRQcK0HgiQm0rtvhVvfqy/ODMPUBCuM+1hotXMmoS0lNt/lt7K97JF+ZGfWmqth2BtfDuh/2WWKkESZk2J5DIVc2n/2excwvtSMmhKU31rV1AB5PwHj3yScMNJM1AA3/d/CCt2nPhA==
  • Delivered-to: cdt-dev@xxxxxxxxxxx
  • Dlp-product: dlpe-windows
  • Dlp-reaction: no-action
  • Dlp-version: 11.2.0.6
  • Ironport-sdr: yEa7ZRFn/0NigFcg9L7LXNL1SdJCQNgofO9XHBW35DSkKUQ1I+FjBTciy+j8usg2EnOLgWLsEA KxJhGGkg29Sw==
  • Ironport-sdr: Jx7oEncdcUI9wyfWvGWT1k9/iLjwr8zDorg6P+Ssieijf+WeCbPyhP10bGcsZPW0X11oB0WYlD cP56iTYFlZww==
  • List-archive: <https://www.eclipse.org/mailman/private/cdt-dev>
  • List-help: <mailto:cdt-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/cdt-dev>, <mailto:cdt-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/cdt-dev>, <mailto:cdt-dev-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AdZcNtrlptS7ROCERZ27YgoYcYGUYQ==
  • Thread-topic: Macros set in external settings provider not visible.

Hi,

I added an External Settings Provider to the CDT-plugin developers guide example. In the provider I add an include path and a macro. In the project properties " C/C++ General > Paths and Symbols" I can see the include but not the macro. The Symbols tab is not there at all. What do I need to add to get the macro visible?

plugin.xml:

   <extension
         id="org.eclipse.cdt.example.toolchain.externalprovider"
         name="Example external provider"
         point="org.eclipse.cdt.core.externalSettingsProvider">
      <provider
            class="org.eclipse.cdt.example.toolchain.MyExternalSettingProvider">
      </provider>
   </extension>


provider class:

public class MyExternalSettingProvider extends CExternalSettingProvider {

    public MyExternalSettingProvider() {
        super();
    }

    @Override
    public CExternalSetting[] getSettings(IProject project, ICConfigurationDescription cfg) {

        List<ICSettingEntry> entries;
        entries = new ArrayList<ICSettingEntry>();

        ICLanguageSettingEntry entry;
        entry = CDataUtil.createCIncludePathEntry("${HOME}/include2", ICSettingEntry.NONE);
        entries.add(entry);

        entry = CDataUtil.createCMacroEntry("EXTERNAL", "erwin", ICSettingEntry.NONE);
        entries.add(entry);

        List<CExternalSetting> settings = new ArrayList<CExternalSetting>();
        CExternalSetting externalSetting = new CExternalSetting(new String[] { "org.eclipse.cdt.core.gcc" }, null, null,
                entries.toArray(new ICSettingEntry[0]));
        settings.add(externalSetting);

        return settings.toArray(new CExternalSetting[0]);
    }

}

Adding the provider:

    public void addExternalProvider(IProject project, ICProjectDescription projectDescription,
            ICConfigurationDescription cfgDescription) throws CoreException {

        // Get existing list of external providers of the configuration.
        List<String> extProviderIds = new ArrayList<String>();
        String[] ids = cfgDescription.getExternalSettingsProviderIds();
        for (String id : ids) {
            extProviderIds.add(id);
        }
        // Add new external provider
        extProviderIds.add("org.eclipse.cdt.example.toolchain.externalprovider");
        cfgDescription.setExternalSettingsProviderIds(extProviderIds.toArray(new String[0]));

        CoreModel.getDefault().setProjectDescription(project, projectDescription);
        System.out.println("Added external provider.");
    }

-- 
Erwin

---------------------------------------------------------------------
Intel Benelux B.V.
Registered in The Netherlands under number 24134020
Statutory seat: Rotterdam
Registered address: Capronilaan 37, 1119NG Schiphol-Rijk

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.



Back to the top