Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow config #defines to be written out to custom config/defines.hpp … #2398

Merged
merged 2 commits into from Nov 19, 2016

Commits on Nov 17, 2016

  1. Allow config #defines to be written out to custom config/defines.hpp …

    …files
    
    The existing cmake macro can be used to generate #defines for the global
    hpx/config/defines.hpp file by using
    
      hpx_add_config_define(HPX_HAVE_LOGGING)
      hpx_add_config_define(HPX_HAVE_MAX_CPU_COUNT ${HPX_WITH_MAX_CPU_COUNT})
      ...
    
    and then written to hpx/config/defines.hpp using a new macro and
    specifying the default namespace
    
    write_config_defines_file(
      TEMPLATE "${PROJECT_SOURCE_DIR}/cmake/templates/config_defines.hpp.in"
      NAMESPACE default
      FILENAME "${CMAKE_BINARY_DIR}/hpx/config/defines.hpp")
    
    This keeps the existing behaviour unchanged.
    However a new NAMESPACE feature is supported to allow the user to add
    
      hpx_add_config_define_namespace(
        DEFINE    HPX_PARCELPORT_VERBS_DEVICE
        VALUE     "\"${HPX_PARCELPORT_VERBS_DEVICE}\""
        NAMESPACE parcelport_verbs)
    
      hpx_add_config_define_namespace(
        DEFINE    HPX_PARCELPORT_VERBS_INTERFACE
        VALUE     "\"${HPX_PARCELPORT_VERBS_INTERFACE}\""
        NAMESPACE parcelport_verbs)
    
    and then to generate a defines.hpp file as follows
    
      write_config_defines_file(
        TEMPLATE ""
        NAMESPACE "parcelport_verbs"
        FILENAME "${CMAKE_BINARY_DIR}/hpx/config/parcelport_verbs_defines.hpp")
    
    when no template is specified, the function will generate a copyright
    block, and include guard #ifndef...#endif section with the #defines between.
    In the above example, the following would be generated from the variables
    
      #define HPX_PARCELPORT_VERBS_DEVICE "mlx5_0"
      #define HPX_PARCELPORT_VERBS_INTERFACE "ib0"
    
    This feature allows a module (e.g. parcelport) to generate #defines without
    writing to the global defines.hpp file and triggering full rebuilds on every change.
    biddisco committed Nov 17, 2016
    Configuration menu
    Copy the full SHA
    a63c2f1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f679220 View commit details
    Browse the repository at this point in the history