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

Switch to ament_generate_version_header for tracetools #112

Merged
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
8 changes: 4 additions & 4 deletions tracetools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
add_compile_options(/W4)
endif()

find_package(ament_cmake_gen_version_h REQUIRED)
find_package(ament_cmake_ros REQUIRED)

if(WIN32 OR APPLE OR ANDROID)
Expand Down Expand Up @@ -102,6 +103,9 @@ if(NOT TRACETOOLS_DISABLED)
set(export_target_options "HAS_LIBRARY_TARGET")
endif()
ament_export_targets(${PROJECT_NAME}_export ${export_target_options})
if(NOT TRACETOOLS_DISABLED)
ament_generate_version_header(${PROJECT_NAME})
endif()

if(TRACETOOLS_STATUS_CHECKING_TOOL)
# Lib for status checking
Expand Down Expand Up @@ -187,7 +191,3 @@ if(BUILD_TESTING)
endif()

ament_package()

if(NOT TRACETOOLS_DISABLED)
target_compile_definitions(${PROJECT_NAME} PRIVATE ${PROJECT_NAME}_VERSION="${${PROJECT_NAME}_VERSION}")
endif()
4 changes: 3 additions & 1 deletion tracetools/include/tracetools/tp_call.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#include <stdint.h>
#include <stdbool.h>

#include "tracetools/version.h"

/// See RMW_GID_STORAGE_SIZE in rmw.
#define TRACETOOLS_GID_STORAGE_SIZE 24u

Expand All @@ -43,7 +45,7 @@ TRACEPOINT_EVENT(
),
TP_FIELDS(
ctf_integer_hex(const void *, context_handle, context_handle_arg)
ctf_string(version, tracetools_VERSION)
ctf_string(version, TRACETOOLS_VERSION_STR)
)
)

Expand Down
1 change: 1 addition & 0 deletions tracetools/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<author email="[email protected]">Ingo Lütkebohle</author>
<author email="[email protected]">Christophe Bedard</author>

<buildtool_depend>ament_cmake_gen_version_h</buildtool_depend>
<buildtool_depend>ament_cmake_ros</buildtool_depend>
<buildtool_depend>pkg-config</buildtool_depend>

Expand Down
Loading