Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Macros set in external settings provider not visible.
  • From: "Waterlander, Erwin" <erwin.waterlander@xxxxxxxxx>
  • Date: Fri, 17 Jul 2020 14:44:26 +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=mlj6bO/PFRtRjtIbUDFCFfZHRoMXUdcaGRBEvPtpzXc=; b=nUdvClW9d1E2+0pdkJqSJKojGJ+x6H32YNe4wViGzTotR1iHRDb4Ms5zPOtaX0VEM/yaVH5fASk4sKYg8XKmQqGzm8F95u8g8FOtUclMpqgnm3YxrB/ILeG/JImgYdspT0fgBR1CQkcRP1F4x5tC+N5uOxk28ywu+LwncvGkqjSVhDRNhxJj7Hg9GVSxCNWJDHQaftFybT+W+FA7xH3Rf7dyfxc3h8Ft8y16sQnpqk8jrwxrAinEqsnbOiD3OcxjMTXW59CAUoy8WJQxqjCkbmSyCb5NEPZaORzn3ZV9MLe0BReauP77QntOYuGGJemprOZbYoMM49H/L+QoFE1WYQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DbpeWerWuzsZN0j4yb0l6Ci+vXuF5mYNDIwEQNC3U8C+p8EATzj9p249FSVWwlUdkOJ/9OV9BclaBiXdbNpOzIOcUsyAVtEy6lmUs7sAxSJgWUskAnyP4EG4DKmtGw6DNTzl3uF116g5+VZhxOWjrFy1wHCj8G0g/D/o2WKtfEKK8LLcq9lwVg3X1qbVndsCsZUSKciLbqRbpAmcQxZBcmQiEF7gpc8bXxwTgP/VxnUSHBjlXk7rP9PVfrOw4Vrovhw06j330JrM8FwjV8j9aYdBGjIiR1qTv83pJK+2+xyujPGjpQlYQ1mRlUt67jiShzvdSuw3JfMGbC22XrEapw==
  • Delivered-to: cdt-dev@xxxxxxxxxxx
  • Dlp-product: dlpe-windows
  • Dlp-reaction: no-action
  • Dlp-version: 11.2.0.6
  • Ironport-sdr: pJXQaz3YNHIqzV8nq4vDbfvUOjnPDvjKClpR1HNQG00eoTdSliqNLAQxhsAYhzznfBmvrYpCaF yRmeC1OzznMw==
  • Ironport-sdr: sJqdcZnJb7v4sX2g/r2rP3/rQz/wzuPZpj4oUtZkBdE/NoaFhsXkd9QpvN4JaMRl9iHWSCVPL7 Yyk3u14yoh5g==
  • 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: AdZcNtrlptS7ROCERZ27YgoYcYGUYQAEUfvQ
  • Thread-topic: Macros set in external settings provider not visible.

The macro became visible when I added an option to the tool with valueType definedSymbols.

plugin.xml:

               <tool
                     command="gcc"
                     id="example.toolchain.compiler1"
                     isAbstract="false"
                     name="Compiler"
                     natureFilter="both"
                     outputFlag="-o">

                .....

                 <option
                        category="example.compiler.optionCategory.general1"
                        id="org.eclipse.cdt.example.toolchain.option1"
                        isAbstract="false"
                        name="Defined Symbols"
                        resourceFilter="all"
                        valueType="definedSymbols">
                  </option>
               </tool>

-- 
Erwin

-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx <cdt-dev-bounces@xxxxxxxxxxx> On Behalf Of Waterlander, Erwin
Sent: Friday, July 17, 2020 14:47
To: CDT General developers list. <cdt-dev@xxxxxxxxxxx>
Subject: [cdt-dev] 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.

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/cdt-dev
---------------------------------------------------------------------
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