Repository navigation
cmake: export ittapi::headers target for collector implementations #259
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,19 +21,21 @@ else() | |
| set(ITT_REFCOL_STANDALONE OFF) | ||
| endif() | ||
|
|
||
| set(ITT_REFCOL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../include") | ||
| set(ITT_REFCOL_ITTNOTIFY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../ittnotify") | ||
|
|
||
| add_library(ittnotify_refcol SHARED itt_refcol_impl.c) | ||
|
|
||
| set_target_properties(ittnotify_refcol PROPERTIES | ||
| LINKER_LANGUAGE C | ||
| POSITION_INDEPENDENT_CODE ON | ||
| OUTPUT_NAME ittnotify_refcol) | ||
|
|
||
| target_include_directories(ittnotify_refcol PRIVATE | ||
| ${ITT_REFCOL_INCLUDE_DIR} | ||
| ${ITT_REFCOL_ITTNOTIFY_DIR}) | ||
| if(ITT_REFCOL_STANDALONE) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| # No root project to provide ittapi::collector_headers. | ||
| target_include_directories(ittnotify_refcol PRIVATE | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/../../include" | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/../ittnotify") | ||
| else() | ||
| target_link_libraries(ittnotify_refcol PRIVATE ittapi::collector_headers) | ||
| endif() | ||
|
|
||
| target_link_libraries(ittnotify_refcol PRIVATE ${CMAKE_DL_LIBS}) | ||
|
|
||
|
|
@@ -59,10 +61,8 @@ set_target_properties(ittnotify_refcol PROPERTIES | |
| option(ITT_API_REFCOL_SMOKE_TESTS "Build reference collector smoke tests" OFF) | ||
| if(ITT_API_REFCOL_SMOKE_TESTS AND NOT ITT_REFCOL_STANDALONE) | ||
| add_executable(refcol_smoke_test tests/smoke_test.c) | ||
| target_include_directories(refcol_smoke_test PRIVATE | ||
| ${ITT_REFCOL_INCLUDE_DIR} | ||
| ${ITT_REFCOL_ITTNOTIFY_DIR}) | ||
| target_link_libraries(refcol_smoke_test PRIVATE ittnotify ${CMAKE_DL_LIBS}) | ||
| target_link_libraries(refcol_smoke_test PRIVATE | ||
| ittnotify ittapi::collector_headers ${CMAKE_DL_LIBS}) | ||
| set_target_properties(refcol_smoke_test PROPERTIES | ||
| RUNTIME_OUTPUT_DIRECTORY "${ITT_REFCOL_OUTPUT_DIR}") | ||
| endif() | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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"