From 4e389a992dc4f517f2a96ef92675aeef8ffd73bd Mon Sep 17 00:00:00 2001 From: Victor Perevertkin Date: Mon, 13 Sep 2021 20:13:40 +0300 Subject: [PATCH] [CMAKE] Fix invalid usage of list() list() functions expects numerical indices for modification operations and silently converts everything else to a number (old behaviour). CMake 3.21 now checks this and throws a warning --- sdk/cmake/CMakeMacros.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/cmake/CMakeMacros.cmake b/sdk/cmake/CMakeMacros.cmake index f254ce3f054..7e4cb21cbe0 100644 --- a/sdk/cmake/CMakeMacros.cmake +++ b/sdk/cmake/CMakeMacros.cmake @@ -287,10 +287,10 @@ function(add_cd_file) endif() # do we add it to all CDs? - list(FIND _CD_FOR all __cd) + list(FIND _CD_FOR "all" __cd) if(NOT __cd EQUAL -1) - list(REMOVE_AT _CD_FOR __cd) - list(INSERT _CD_FOR __cd "bootcd;livecd;regtest") + list(REMOVE_ITEM _CD_FOR "all") + list(APPEND _CD_FOR "bootcd;livecd;regtest") endif() # do we add it to bootcd?