Skip to content

Stop googletest in subprojects #17

@ruairimoran

Description

@ruairimoran

Problem

  • In the example folder, the cmake file fetches GPUtils.
  • This causes a further fetch of googletest.
  • Then googletest slows down the building process of the example project.
  • We need to prevent gtest either from getting into the fetch or from being built by the example project.

Current solution

Make a release branch, and comment out the second part of the root CMakeLists.txt file

Proper solution

Use flags to default=OFF the debug parts of CMakeLists.txt file:

if(NOT GPUTILS_BUILD_TESTING)
    set(GPUTILS_BUILD_TESTING OFF)
endif()
if (GPUTILS_BUILD_TESTING)
    add_subdirectory(tests)
endif()
unset(GPUTILS_BUILD_TESTING CACHE)

Then, when building, pass the flag setting you want. For example, in the ci script

cmake -S . -B ./build -Wno-dev -DGPUTILS_BUILD_TESTING=ON

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions