Make C++ build output more pretty

Avoid empty lines in stderr from the compiler, and make sure
the description from the compile line mention the output target
instead of not the source tomake it consistant with other outputs
This commit is contained in:
Olivier Goffart 2020-11-17 15:08:42 +01:00
parent 7a746c15da
commit ba0ec058ab
2 changed files with 5 additions and 3 deletions

View file

@ -12,14 +12,12 @@ function(SIXTYFPS_TARGET_60_SOURCES target)
foreach (it IN ITEMS ${ARGN})
get_filename_component(_60_BASE_NAME ${it} NAME_WE)
get_filename_component(_60_ABSOLUTE ${it} REALPATH BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_60_BASE_NAME}.h
COMMAND SixtyFPS::sixtyfps_compiler ${_60_ABSOLUTE} > ${CMAKE_CURRENT_BINARY_DIR}/${_60_BASE_NAME}.h
DEPENDS ${_60_ABSOLUTE}
COMMENT "Running sixtyfps_compiler on ${it}")
COMMENT "Generating ${_60_BASE_NAME}.h")
target_sources(${target} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/${_60_BASE_NAME}.h)
endforeach()
# FIXME: DO WE NEED THIS HERE?
target_include_directories(${target} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
endfunction()

View file

@ -198,6 +198,10 @@ impl FileDiagnostics {
Option<&'b codemap::CodeMap>,
) -> codemap_diagnostic::Emitter<'b>,
) {
if self.inner.is_empty() {
return;
}
let mut codemap = codemap::CodeMap::new();
let internal_errors = self.source.is_none();
let file = codemap.add_file(