2022-01-19 01:07:49 +03:00
|
|
|
# Copyright (C) 2018-2022 Intel Corporation
|
2020-12-23 08:01:07 +03:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
if(UNIX AND ENABLE_ERROR_HIGHLIGHT)
|
|
|
|
|
function(message)
|
|
|
|
|
string(ASCII 27 ESC)
|
|
|
|
|
set(RESET "${ESC}[m")
|
|
|
|
|
set(RED "${ESC}[31;1m")
|
|
|
|
|
set(YELLOW "${ESC}[33;1m")
|
|
|
|
|
|
|
|
|
|
list(GET ARGV 0 MessageType)
|
2020-12-24 08:07:50 +03:00
|
|
|
list(REMOVE_AT ARGV 0)
|
2021-01-19 15:35:31 +03:00
|
|
|
|
|
|
|
|
foreach(arg IN LISTS ARGV)
|
|
|
|
|
set(_msg "${_msg}${arg}")
|
|
|
|
|
endforeach()
|
|
|
|
|
|
2020-12-23 08:01:07 +03:00
|
|
|
if(MessageType STREQUAL FATAL_ERROR OR MessageType STREQUAL SEND_ERROR)
|
2021-01-19 15:35:31 +03:00
|
|
|
_message(${MessageType} "${RED}${_msg}${RESET}")
|
2020-12-23 08:01:07 +03:00
|
|
|
elseif(MessageType STREQUAL WARNING)
|
2021-01-19 15:35:31 +03:00
|
|
|
_message(${MessageType} "${YELLOW}${_msg}${RESET}")
|
2020-12-23 08:01:07 +03:00
|
|
|
else()
|
2021-01-19 15:35:31 +03:00
|
|
|
_message(${MessageType} "${_msg}")
|
2020-12-23 08:01:07 +03:00
|
|
|
endif()
|
|
|
|
|
endfunction()
|
|
|
|
|
endif()
|