Skip to content

Refactor AISUseGTest.cmake to eliminate FetchContent_Declare duplication#211

Closed
Copilot wants to merge 2 commits intoderobins/sanitizersfrom
copilot/sub-pr-210
Closed

Refactor AISUseGTest.cmake to eliminate FetchContent_Declare duplication#211
Copilot wants to merge 2 commits intoderobins/sanitizersfrom
copilot/sub-pr-210

Conversation

Copy link

Copilot AI commented Mar 5, 2026

The sanitizer-aware GTest CMake had two nearly-identical FetchContent_Declare blocks differing only in FIND_PACKAGE_ARGS.

Refactored to a single FetchContent_Declare by conditionally setting _gtest_find_package_args:

if(AIS_USE_SANITIZERS OR AIS_USE_INTEGER_SANITIZER OR AIS_USE_THREAD_SANITIZER)
    set(_gtest_find_package_args "")
else()
    set(_gtest_find_package_args FIND_PACKAGE_ARGS NAMES GTest)
endif()

FetchContent_Declare(
  googletest
  URL https://github.com/google/googletest/releases/download/v1.17.0/googletest-1.17.0.tar.gz
  DOWNLOAD_EXTRACT_TIMESTAMP true
  ${_gtest_find_package_args}
  SYSTEM
)

Part of AIHIPFILE-62


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: derobins <43805+derobins@users.noreply.github.com>
Copilot AI changed the title [WIP] Update GTest CMake for use w/ sanitizers Refactor AISUseGTest.cmake to eliminate FetchContent_Declare duplication Mar 5, 2026
@derobins derobins closed this Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants