From d0e1449c2aea92c8d78d4e356c20535b3ef2fa06 Mon Sep 17 00:00:00 2001 From: Diego Ferigo Date: Mon, 5 Apr 2021 20:08:53 +0200 Subject: [PATCH] Introduce support to profile Physics system --- cpp/scenario/CMakeLists.txt | 3 +++ cpp/scenario/plugins/Physics/CMakeLists.txt | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/cpp/scenario/CMakeLists.txt b/cpp/scenario/CMakeLists.txt index 1f1cffe53..7721c9f77 100644 --- a/cpp/scenario/CMakeLists.txt +++ b/cpp/scenario/CMakeLists.txt @@ -9,6 +9,9 @@ set(SCENARIO_PRIVATE_DEPENDENCIES "") if(SCENARIO_USE_IGNITION) + option(ENABLE_PROFILER "Enable Ignition Profiler" OFF) + mark_as_advanced(ENABLE_PROFILER) + add_subdirectory(gazebo) add_subdirectory(plugins) add_subdirectory(controllers) diff --git a/cpp/scenario/plugins/Physics/CMakeLists.txt b/cpp/scenario/plugins/Physics/CMakeLists.txt index ce817beb3..0ca0be299 100644 --- a/cpp/scenario/plugins/Physics/CMakeLists.txt +++ b/cpp/scenario/plugins/Physics/CMakeLists.txt @@ -41,6 +41,10 @@ target_link_libraries(PhysicsSystem target_include_directories(PhysicsSystem PRIVATE $) +if(ENABLE_PROFILER) + target_compile_definitions(PhysicsSystem PRIVATE "IGN_PROFILER_ENABLE=1") +endif() + # =================== # Install the targets # ===================