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

Re-enabled tracing for external project builds #140

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
pull_request:
branches:
- master
workflow_dispatch:

name: cactus-rt

Expand Down
47 changes: 24 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,8 @@ endfunction()
# Cactus RT library #
#####################

if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME})
if (ENABLE_TRACING)
add_subdirectory(protos)
endif()
if (ENABLE_TRACING)
add_subdirectory(protos)
endif()

add_library(cactus_rt
Expand Down Expand Up @@ -136,28 +134,31 @@ target_link_libraries(cactus_rt
# Use a bounded queue
target_compile_definitions(cactus_rt PUBLIC QUILL_USE_BOUNDED_QUEUE)

if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME})
if (ENABLE_TRACING)
target_sources(cactus_rt
PRIVATE
src/cactus_rt/tracing/sink.cc
src/cactus_rt/tracing/thread_tracer.cc
src/cactus_rt/tracing/trace_aggregator.cc
src/cactus_rt/tracing/tracing_enabled.cc
src/cactus_rt/tracing/utils/string_interner.cc
)
# Build optional tracing sources
if (ENABLE_TRACING)
message(STATUS "Building tracing sources. Turn it off via ENABLE_TRACING=OFF")
target_sources(cactus_rt
PRIVATE
src/cactus_rt/tracing/sink.cc
src/cactus_rt/tracing/thread_tracer.cc
src/cactus_rt/tracing/trace_aggregator.cc
src/cactus_rt/tracing/tracing_enabled.cc
src/cactus_rt/tracing/utils/string_interner.cc
)

target_link_libraries(cactus_rt
PUBLIC
cactus_tracing_embedded_perfetto_protos
)
target_link_libraries(cactus_rt
PUBLIC
cactus_tracing_embedded_perfetto_protos
)

target_compile_definitions(cactus_rt
PUBLIC
CACTUS_RT_TRACING_ENABLED=1
)
endif()
target_compile_definitions(cactus_rt
PUBLIC
CACTUS_RT_TRACING_ENABLED=1
)
endif()

# Run clang-tidy, only if this project is not embedded in another project.
if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME})
if (ENABLE_CLANG_TIDY)
find_program(CLANG_TIDY clang-tidy clang-tidy-18 clang-tidy-17 clang-tidy-16 clang-tidy-15 clang-tidy-14)
else()
Expand Down