Feature request: allow include search path to propagate upward from dependencies (i.e., be like cmake)

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Feature request: allow include search path to propagate upward from dependencies (i.e., be like cmake)

      For many years the cmake build system has supported a very useful usage model where as part of defining a library target, you can specify the include search paths for public dependencies via the `target_include_directories` command. These search paths are stored by the build system until the library is later linked into an executable via the `target_link_libraries` command. At this point the necessary include paths are propagated upward so the source files of the executable can be built using the search paths dictated by their dependencies.

      This works transitively up the dependency tree as libraries that depend on other libraries are linked into an exe. There is analogous functionality for propagating compile definitions. This can be very handy for avoiding ODR violations since you can guarantee that when a client includes a header it will be built with the same definitions as (or at least a superset of) those used when the library dependency was built.

      It all just works.

      In SES, you can mark an EXE project as depending on a LIB project, and the build system will take care of rebuilding the dependency, as needed. However, there is no way for the dependency to propagate the search path or compile definitions up to the final exe. The include_path needs to be specified manually via the "User Include Directories" property of the EXE project, and similarly for the Proprocessor Definitions. This is error-prone and doesn't scale.

      You can read a bit about how this works with cmake here.

      Segger has been making great strides to modernize the embedded development workflow and I think adding this feature would help take the build system to the next level.
    • Hello,

      Thank you for your inquiry.
      To make sure we understand you correctly here, you are essentially looking for a way to inherit include paths that are set in e.g. a library project also to the executable project in the same solution.
      Is that correct so far? If yes then you can do this via solution settings instead of project settings. That way all projects within the solution will inherit the options set on solution level.

      Is this what you are looking for?

      Best regards,
      Nino
      Please read the forum rules before posting: Forum Rules

      Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.