Skip to content

Commit

Permalink
always compile profiler
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <louise@openrobotics.org>
  • Loading branch information
chapulina committed Aug 5, 2020
1 parent e5377c3 commit 0afd239
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 46 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if(NOT DEFINED BUILD_TESTING)
set(BUILD_TESTING OFF)
endif()

option(ENABLE_PROFILER "Enable Ignition Profiler" FALSE)
option(ENABLE_PROFILER "Enable Gazebo Profiler" FALSE)

if(ENABLE_PROFILER)
add_definitions("-DGZ_PROFILER_ENABLE=1")
Expand Down
88 changes: 43 additions & 45 deletions gazebo/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,63 +215,61 @@ if (HAVE_IGNITION_FUEL_TOOLS)
)
endif()

# Do not install profiler headers.
if(ENABLE_PROFILER)
set (sources ${sources}
Profiler.cc
)

set (remotery_sources
./Remotery/lib/Remotery.c
./Remotery/lib/Remotery.h
RemoteryProfilerImpl.cc
)
# Start profiler
set (sources ${sources}
Profiler.cc
)

if (APPLE)
set (remotery_sources ${remotery_sources}
./Remotery/lib/RemoteryMetal.mm
)
find_library(FOUNDATION Foundation
HINTS /System/Library/Frameworks
)
endif()
set (remotery_sources
./Remotery/lib/Remotery.c
./Remotery/lib/Remotery.h
RemoteryProfilerImpl.cc
)

list(APPEND sources ${remotery_sources})
if (APPLE)
set (remotery_sources ${remotery_sources}
./Remotery/lib/RemoteryMetal.mm
)
find_library(FOUNDATION Foundation
HINTS /System/Library/Frameworks
)
endif()

set(RMT_ENABLED 1)
set(RMT_USE_TINYCRT 0)
set(RMT_USE_CUDA 0)
set(RMT_USE_D3D11 0)
set(RMT_USE_OPENGL 0)
set(RMT_USE_METAL 0)
list(APPEND sources ${remotery_sources})

if(UNIX OR WIN32)
set(RMT_USE_OPENGL 1)
endif()
set(RMT_ENABLED 1)
set(RMT_USE_TINYCRT 0)
set(RMT_USE_CUDA 0)
set(RMT_USE_D3D11 0)
set(RMT_USE_OPENGL 0)
set(RMT_USE_METAL 0)

if(WIN32)
set(RMT_USE_D3D11 1)
endif()
if(UNIX OR WIN32)
set(RMT_USE_OPENGL 1)
endif()

if(APPLE)
set (RMT_USE_METAL 1)
endif()
if(WIN32)
set(RMT_USE_D3D11 1)
endif()

configure_file(RemoteryConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/RemoteryConfig.h)
if(APPLE)
set (RMT_USE_METAL 1)
endif()

set(GZ_PROFILER_VIS_PATH share/gazebo-${GAZEBO_MAJOR_VERSION}/profiler_vis)
configure_file(RemoteryConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/RemoteryConfig.h)

configure_file(Remotery/gz_remotery_vis.in
${CMAKE_CURRENT_BINARY_DIR}/gz_remotery_vis)
set(GZ_PROFILER_VIS_PATH share/gazebo-${GAZEBO_MAJOR_VERSION}/profiler_vis)

install(PROGRAMS
${CMAKE_CURRENT_BINARY_DIR}/gz_remotery_vis
DESTINATION bin)
configure_file(Remotery/gz_remotery_vis.in
${CMAKE_CURRENT_BINARY_DIR}/gz_remotery_vis)

install(DIRECTORY Remotery/vis/
DESTINATION ${CMAKE_INSTALL_PREFIX}/${GZ_PROFILER_VIS_PATH})
install(PROGRAMS
${CMAKE_CURRENT_BINARY_DIR}/gz_remotery_vis
DESTINATION bin)

endif()
install(DIRECTORY Remotery/vis/
DESTINATION ${CMAKE_INSTALL_PREFIX}/${GZ_PROFILER_VIS_PATH})
# End profiler

gz_build_tests(${gtest_sources} EXTRA_LIBS gazebo_common ${tinyxml_LIBRARIES})

Expand Down
4 changes: 4 additions & 0 deletions gazebo/common/Profiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
*
*/

/*
This is a backport of Ignition Common's profiler
*/

#include "Profiler.hh"
#include "ProfilerImpl.hh"
#include "RemoteryProfilerImpl.hh"
Expand Down
4 changes: 4 additions & 0 deletions gazebo/common/ProfilerImpl.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
*
*/

/*
This is a backport of Ignition Common's profiler
*/

#ifndef GAZEBO_COMMON_PROFILERIMPL_HH_
#define GAZEBO_COMMON_PROFILERIMPL_HH_

Expand Down
4 changes: 4 additions & 0 deletions gazebo/common/RemoteryProfilerImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
*
*/

/*
This is a backport of Ignition Common's profiler
*/

#include "RemoteryProfilerImpl.hh"
#include "gazebo/common/Console.hh"

Expand Down
4 changes: 4 additions & 0 deletions gazebo/common/RemoteryProfilerImpl.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
*
*/

/*
This is a backport of Ignition Common's profiler
*/

#ifndef GAZEBO_COMMON_REMOTERYPROFILERIMPL_HH_
#define GAZEBO_COMMON_REMOTERYPROFILERIMPL_HH_

Expand Down

0 comments on commit 0afd239

Please sign in to comment.