Errors and warnings highlighting for UNIX platforms (#3643)

* Errors and warnings highlighting for UNIX platforms

* The option added for errors and warning highlighting enabling
This commit is contained in:
Vladislav Volkov
2020-12-23 08:01:07 +03:00
committed by GitHub
parent bc2bd04144
commit 96b032504e
3 changed files with 26 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ endfunction()
set_ci_build_number()
include(features)
include(message)
#
# Detect target

View File

@@ -0,0 +1,23 @@
# Copyright (C) 2018-2020 Intel Corporation
# 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)
if(MessageType STREQUAL FATAL_ERROR OR MessageType STREQUAL SEND_ERROR)
list(REMOVE_AT ARGV 0)
_message(${MessageType} "${RED}${ARGV}${RESET}")
elseif(MessageType STREQUAL WARNING)
list(REMOVE_AT ARGV 0)
_message(${MessageType} "${YELLOW}${ARGV}${RESET}")
else()
_message("${ARGV}")
endif()
endfunction()
endif()

View File

@@ -25,6 +25,8 @@ In case SELECTIVE_BUILD is enabled, the SELECTIVE_BUILD_STAT variable should con
Usage: -DSELECTIVE_BUILD=ON -DSELECTIVE_BUILD_STAT=/path/*.csv" OFF
ALLOWED_VALUES ON OFF COLLECT)
ie_option(ENABLE_ERROR_HIGHLIGHT "Highlight errors and warnings during compile time" OFF)
#
# Process options
#