Libelektra: ELEKTRA_PLUGIN_NAME

Created on 22 Oct 2016  路  9Comments  路  Source: ElektraInitiative/libelektra

Build system should provide:

  • a string that contains the plugin/module name
  • a non-string variant of the plugin/module name

Then ELEKTRA_PLUGIN_EXPORT, ELEKTRA_PLUGIN_FUNCTION, ELEKTRA_README would have one paramter less.

build enhancement

Most helpful comment

Progress so far

2360 : The CMake module add_plugin provides the following compiler definitions for every plugin:

  • ELEKTRA_PLUGIN_NAME: the plugin name (including the variant if any) as string
  • ELEKTRA_PLUGIN_NAME_C: the plugin name without quotes, so it can be used to construct function names, that depend on the plugin name/variant.

The removal of unnecessary parameters of ELEKTRA_PLUGIN_FUNCTION and CRYPTO_PLUGIN_FUNCTION will be implemented in another PR.

All 9 comments

@petermax2 Do you maybe want to implement this?

Yes, you can assign me if the implementation is not time critical. At the moment I have not so much spare time.

Thank you for working on this!

The actual reason to do this, is that every plugin has something like CRYPTO_PLUGIN_FUNCTION available and that CRYPTO_PLUGIN_FUNCTION is not needed anymore.

Btw. ARG_COMPILE_DEFINITIONS cannot be modified (due to restore_variable), so simply add further definitions in cmake/Modules/LibAddPlugin.cmake line 155 (where COMPILE_DEFINITIONS are defined).

Btw. ARG_COMPILE_DEFINITIONS cannot be modified (due to restore_variable), so simply add further definitions in cmake/Modules/LibAddPlugin.cmake line 155 (where COMPILE_DEFINITIONS are defined).

It works for "regular" plugins (without compilation variant), now I'm looking into plugin variants.

Great that you have progress!

Progress so far

2360 : The CMake module add_plugin provides the following compiler definitions for every plugin:

  • ELEKTRA_PLUGIN_NAME: the plugin name (including the variant if any) as string
  • ELEKTRA_PLUGIN_NAME_C: the plugin name without quotes, so it can be used to construct function names, that depend on the plugin name/variant.

The removal of unnecessary parameters of ELEKTRA_PLUGIN_FUNCTION and CRYPTO_PLUGIN_FUNCTION will be implemented in another PR.

So ELEKTRA_PLUGIN_EXPORT and ELEKTRA_README are the last left-overs?

So ELEKTRA_PLUGIN_EXPORT and ELEKTRA_README are the last left-overs?

Yes, should be very easy and straight-forward now that ELEKTRA_PLUGIN_FUNCTION works.

We finally did it!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mpranj picture mpranj  路  3Comments

dmoisej picture dmoisej  路  3Comments

markus2330 picture markus2330  路  3Comments

dominicjaeger picture dominicjaeger  路  3Comments

mpranj picture mpranj  路  3Comments