cmake: hwmv2: optimize hardware list parsing with CMake lists

Replace inefficient string parsing loop with CMake list iteration for
processing list_hardware.py output. The previous implementation used
repeated string operations on the entire output string for each line,
which is increasingly slow as hardware list grows.

Local tests show hwmv2.cmake module loading in ~350 ms instead of
540 ms on my machine.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
1 file changed