Skip to content

cmake: export ittapi::headers target for collector implementations - #259

Open
Skyb0rg007 wants to merge 1 commit into
intel:masterfrom
Skyb0rg007:install-collector-headers
Open

Skyb0rg007 wants to merge 1 commit into
intel:masterfrom
Skyb0rg007:install-collector-headers

Conversation

@Skyb0rg007

Copy link
Copy Markdown

Add an ittapi::headers interface target that provides the public and collector headers.
The pti-gpu project expects this interface to exist (code), and exporting the headers as a target lets downstream clients properly depend on the header files.

@Skyb0rg007
Skyb0rg007 force-pushed the install-collector-headers branch from 3b22029 to c988c3b Compare November 6, 2026 02:42

@eparshut eparshut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Skyb0rg007, thanks for contributing! Exporting the headers as a proper target makes sense, and moving GNUInstallDirs earlier is a good catch.

There are a few things I would like to change:

  • Keep ittapi::headers public-only. ittnotify_config.h is an internal header, and it changes the build of any code that includes it (<windows.h>, UNICODE, _GNU_SOURCE, weak pthread symbols). Please move it and ittnotify_types.h into a separate target, e.g. for example ittapi::collector_headers.
  • Don't expose src/ittnotify. It also leaks ittnotify_static.h and other internal headers. Copy just the two headers into the build directory, laid out the same way as in the install tree.
  • Make installing them opt-in. Add an option that is OFF by default, since these are internal headers meant only for collectors.
  • Use the new target in ittnotify_refcol. Then our own CI tests it. The target needs to be defined before the add_subdirectory call for the reference collector.

Add an ittapi::headers interface target that provides the collector
headers.
@Skyb0rg007
Skyb0rg007 force-pushed the install-collector-headers branch from c988c3b to 77d92b8 Compare November 6, 2026 18:37
target_include_directories(ittnotify_refcol PRIVATE
${ITT_REFCOL_INCLUDE_DIR}
${ITT_REFCOL_ITTNOTIFY_DIR})
if(ITT_REFCOL_STANDALONE)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user installs itt and tries to use their ITT headers with the reference collector, this will use ITT's current headers. Maybe check whether ittapi::collector_header exists first and redefine it with the two directories below if it doesn't?

Optional: up to @eparshut and @Skyb0rg007

Comment thread CMakeLists.txt
)
add_library(ittapi::headers ALIAS ittapi_headers)

# Internal headers for collector implementations. Including them changes the

@mschilling0 mschilling0 Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like @eparshut suggestion. This is sort of exposing a public interface, regardless of intentions, so we need to be careful saying these are public or not. Use at your own risk. Otherwise, you want to change internal implementation of these files and boom - users complains when it changes and says you need to bump version.

Maybe a documented disclaimer, say collectors use at your own risk - API between collector and source is stable but not promising anything for internal stuff. Anything not in ittapi::headers is "use at your own risk"

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants