Skip to content

Find a better way of dealing with internal copies of gtest and backwards #477

@j-rivero

Description

@j-rivero

Desired behavior

Eliminate the embedded copies of gtest and backwards from the gz libraries and centralize.
Context in the conversation thread gazebosim/gz-sim#2776 (comment)

Having the libraries vendored in the packages has an impact in the size and number of files in the repositories, downloading times and specially in how we maintain them.

Alternatives considered

Keep maintaining the embedded copies.

Implementation suggestion

For gtest

We probably need to add the find_package to gz-cmake and rework the CMakeLists.txt in the consumers of gz-cmake.

For backwards test compatibility

We could add some CMake code to gz-cmake that handles: the optional use of backward-cpp, the look for the system support or internal vendoring (to keep support for gz-utils/gz-launch) and the extra linking needed. Maybe creating a new FEATURES block for the gz_build_tests, something like:

gz_build_tests(TYPE UNIT
  SOURCES
     ${gtest_sources}
  LIB_DEPS
     ....
  FEATURES
     USE_BACKWARDS_CPP=ON

Other context

Important to note that not all distributions have backwards-cpp packages (like Fedora). Specially important for us is the lack of it in Brew for Mac. Either send the a new Formula to HomebreCask or implement a feature to grab the sources using FetchContent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Inbox

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions