Commit 7ddc2a11 authored by Craig Scott's avatar Craig Scott
Browse files

GoogleTest: Ensure policy settings allow use of IN_LIST

If policy settings at the time the GoogleTest module is included are
such that CMP0057 is unset or set to OLD, the use of IN_LIST with
if() will lead to an error. Therefore, explicitly specify the policy
settings for the whole file to ensure the function implementations
have access to the required CMake features.

Fixes: #18198
parent b5061e02
......@@ -238,6 +238,10 @@ same as the Google Test name (i.e. ``suite.testcase``); see also
#]=======================================================================]
# Save project's policies
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
#------------------------------------------------------------------------------
function(gtest_add_tests)
......@@ -454,3 +458,6 @@ endfunction()
set(_GOOGLETEST_DISCOVER_TESTS_SCRIPT
${CMAKE_CURRENT_LIST_DIR}/GoogleTestAddTests.cmake
)
# Restore project's policies
cmake_policy(POP)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment