scripts: size_report: Fix colorized output
Colorama needs to be initialized, and for colors to display correctly on Windows one needs to use the `USES_TERMINAL` option in CMake. Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
parent
cf2b3596f7
commit
f8ad4d5f87
|
@ -15,6 +15,7 @@ foreach(report ram_report rom_report)
|
|||
${flag_for_${report}}
|
||||
DEPENDS ${logical_target_for_zephyr_elf}
|
||||
$<TARGET_PROPERTY:zephyr_property_target,${report}_DEPENDENCIES>
|
||||
USES_TERMINAL
|
||||
)
|
||||
endforeach()
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ from elftools.dwarf.locationlists import (
|
|||
if LooseVersion(elftools.__version__) < LooseVersion('0.24'):
|
||||
sys.exit("pyelftools is out of date, need version 0.24 or later")
|
||||
|
||||
from colorama import Fore
|
||||
from colorama import init, Fore
|
||||
|
||||
from anytree import RenderTree, NodeMixin, findall_by_attr
|
||||
from anytree.exporter import JsonExporter
|
||||
|
@ -586,6 +586,9 @@ def parse_args():
|
|||
def main():
|
||||
parse_args()
|
||||
|
||||
# Init colorama
|
||||
init()
|
||||
|
||||
assert os.path.exists(args.kernel), "{0} does not exist.".format(args.kernel)
|
||||
|
||||
elf = ELFFile(open(args.kernel, "rb"))
|
||||
|
|
Loading…
Reference in New Issue