Skip to content

Commit

Permalink
Switch to ament_generate_version_header for tracetools
Browse files Browse the repository at this point in the history
Signed-off-by: Christophe Bedard <[email protected]>
  • Loading branch information
christophebedard committed Apr 12, 2024
1 parent 02d23c6 commit a3619bf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 2 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,7 @@ if(NOT TRACETOOLS_DISABLED)
set(export_target_options "HAS_LIBRARY_TARGET")
endif()
ament_export_targets(${PROJECT_NAME}_export ${export_target_options})
ament_generate_version_header(${PROJECT_NAME})

if(TRACETOOLS_STATUS_CHECKING_TOOL)
# Lib for status checking
Expand Down Expand Up @@ -187,7 +189,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

0 comments on commit a3619bf

Please sign in to comment.