Skip to content

Commit

Permalink
Only look for psutil if testing is enabled (#1495)
Browse files Browse the repository at this point in the history
This avoids an unnecessary CMake warning on builds where tests are
disabled, such as [sdformat_vendor](https://github.com/gazebo-release/sdformat_vendor)

Signed-off-by: Addisu Z. Taddese <[email protected]>
Co-authored-by: Steve Peters <[email protected]>
(cherry picked from commit 9661794)
  • Loading branch information
azeey authored and mergify[bot] committed Nov 26, 2024
1 parent 993d04f commit 191a9a7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,11 @@ if (BUILD_SDF)

################################################
# Find psutil python package for memory tests
find_python_module(psutil)
if (NOT PY_PSUTIL)
gz_build_warning("Python psutil package not found. Memory leak tests will be skipped")
if (BUILD_TESTING)
find_python_module(psutil)
if (NOT PY_PSUTIL)
gz_build_warning("Python psutil package not found. Memory leak tests will be skipped")
endif()
endif()

########################################
Expand Down

0 comments on commit 191a9a7

Please sign in to comment.