Only build and run tracing tests if LTTng is enabled and found

This commit is contained in:
Christophe Bedard 2019-07-12 10:06:52 +02:00
parent 05863a35c6
commit 3542aab984
3 changed files with 43 additions and 24 deletions

View file

@ -91,9 +91,12 @@ if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
ament_add_gtest(test_utils test/test_utils.cpp)
if(TARGET test_utils)
target_link_libraries(test_utils ${PROJECT_NAME} -rdynamic)
# Only build tracetools utils tests if LTTng is enabled and found
if(TRACETOOLS_LTTNG_ENABLED)
ament_add_gtest(test_utils test/test_utils.cpp)
if(TARGET test_utils)
target_link_libraries(test_utils ${PROJECT_NAME} -rdynamic)
endif()
endif()
endif()