Skip to content

Commit cba1a32

Browse files
authored
Prevent arm-runtime CMake arguments persisting over loops (#587)
The additional_cmake_args variable is used to override the defaults and disable testing so that it can be controlled by the higher-level CMake project. But the variable is currently set only when the tests should be disabled. If the tests do not need to be disabled, the value is not updated and the version from the previous iteration of the loop will be used, potentially incorrectly disabling the tests. To fix this, clear the value on every loop if not needed.
1 parent 14871ac commit cba1a32

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arm-multilib/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ math(EXPR lib_count_dec "${lib_count} - 1")
136136
foreach(lib_idx RANGE ${lib_count_dec})
137137
string(JSON lib_def GET ${multilib_defs} ${lib_idx})
138138
string(JSON variant GET ${lib_def} "variant")
139+
set(additional_cmake_args "")
139140

140141
if(variant IN_LIST ENABLE_VARIANTS OR ENABLE_VARIANTS STREQUAL "all")
141142
string(JSON variant_multilib_flags GET ${lib_def} "flags")
@@ -164,7 +165,7 @@ foreach(lib_idx RANGE ${lib_count_dec})
164165
# FVP testing should default to off, so override any
165166
# settings from the JSON.
166167
if(test_executor STREQUAL "fvp" AND NOT ${ENABLE_FVP_TESTING})
167-
set(additional_cmake_args "-DENABLE_LIBC_TESTS=OFF" "-DENABLE_COMPILER_RT_TESTS=OFF" "-DENABLE_LIBCXX_TESTS=OFF")
168+
list(APPEND additional_cmake_args "-DENABLE_LIBC_TESTS=OFF" "-DENABLE_COMPILER_RT_TESTS=OFF" "-DENABLE_LIBCXX_TESTS=OFF")
168169
set(read_ENABLE_LIBC_TESTS "OFF")
169170
set(read_ENABLE_COMPILER_RT_TESTS "OFF")
170171
set(read_ENABLE_LIBCXX_TESTS "OFF")

0 commit comments

Comments
 (0)