fxos: add a CMake option to post-process compiler logs
This commit is contained in:
parent
6406f05eb2
commit
3e620280c0
|
@ -6,6 +6,24 @@ add_compile_options(
|
|||
-Wall -Wextra -D_GNU_SOURCE -std=c++17 -O2
|
||||
-fmacro-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}/=)
|
||||
|
||||
# Diagnostic options to clean up output a little bit
|
||||
if(FXOS_CLEAN_LOGS)
|
||||
add_compile_options(
|
||||
-fdiagnostics-urls=never -fno-diagnostics-show-caret
|
||||
-fdiagnostics-color=always -fno-diagnostics-show-labels -fno-show-column)
|
||||
# Filter the compiler output through a filter script
|
||||
file(WRITE "${PROJECT_BINARY_DIR}/compiler_filter.sh" "\
|
||||
set -e \n\
|
||||
set -o pipefail \n\
|
||||
\"$@\" |& sed 's#${PROJECT_SOURCE_DIR}/##g' \n\
|
||||
")
|
||||
file(CHMOD "${PROJECT_BINARY_DIR}/compiler_filter.sh"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
|
||||
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE
|
||||
"${PROJECT_BINARY_DIR}/compiler_filter.sh")
|
||||
endif()
|
||||
|
||||
#---
|
||||
# fxos core
|
||||
#---
|
||||
|
|
|
@ -33,11 +33,14 @@ requirements.
|
|||
* flex (2.6.4)
|
||||
* CMake (3.15) and make (eg. 4.2.1)
|
||||
|
||||
The only real configure option is the install path. CMake's default is
|
||||
There are two configure options:
|
||||
|
||||
* `-DCMAKE_INSTALL_PREFIX=<PATH>`: the install path. CMake's default is
|
||||
`/usr/local`; a viable alternative is `$HOME/.local`.
|
||||
* `-DFXOS_CLEAN_LOGS=1`: enables basic compiler output filtering to get error messages under control. Tested with GCC.
|
||||
|
||||
```sh
|
||||
% cmake -B build # -DCMAKE_INSTALL_PREFIX=$HOME/.local
|
||||
% cmake -B build # -DCMAKE_INSTALL_PREFIX=$HOME/.local -DFXOS_CLEAN_LOGS=1
|
||||
% make -C build -j$(nproc) install
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue