Skip to content

Commit b61f976

Browse files
committed
refactor: corrected ColourReset to be the correct Ansi sequence, added colour.cmake to the documentation tests
1 parent 44bd22a commit b61f976

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

cmake/colour.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
if(NOT WIN32)
22
string(ASCII 27 Esc)
3-
set(ColourReset "${Esc}[m")
3+
set(ColourReset "${Esc}[0m")
44
set(ColourBold "${Esc}[1m")
55
set(Red "${Esc}[31m")
66
set(Green "${Esc}[32m")

docpages/example_code/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131
cmake_minimum_required (VERSION 3.16)
3232
project(documentation_tests)
3333

34-
string(ASCII 27 Esc)
34+
include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/colour.cmake")
3535

3636
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDPP_CORO -std=c++20 -pthread -O0 -fPIC -rdynamic -DFMT_HEADER_ONLY -Wall -Wextra -Wpedantic -Werror -Wno-unused-parameter -Wno-deprecated-declarations")
3737
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
3838

3939
file(GLOB example_list ./*.cpp)
4040
foreach (example ${example_list})
4141
get_filename_component(examplename ${example} NAME)
42-
message(STATUS "Found example '${Esc}[1;34m${examplename}${Esc}[m'")
42+
message(STATUS "Found example '${BoldBlue}${examplename}${ColourReset}'")
4343
add_executable(${examplename}_out ${example})
4444
target_link_libraries(${examplename}_out dl dpp mpg123 oggz ogg opusfile opus)
4545
include_directories(/usr/include/opus)

0 commit comments

Comments
 (0)