fxos: set optimization level depending on build type
This commit is contained in:
parent
3e620280c0
commit
b5d7947958
|
@ -3,8 +3,11 @@ project(fxos LANGUAGES C CXX)
|
|||
find_package(FLEX 2.6)
|
||||
|
||||
add_compile_options(
|
||||
-Wall -Wextra -D_GNU_SOURCE -std=c++17 -O2
|
||||
-fmacro-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}/=)
|
||||
-Wall -Wextra -D_GNU_SOURCE -std=c++17
|
||||
-fmacro-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}/=
|
||||
$<$<CONFIG:Debug>:-O0> $<$<CONFIG:Debug>:-g>
|
||||
$<$<CONFIG:Release>:-O2>)
|
||||
|
||||
|
||||
# Diagnostic options to clean up output a little bit
|
||||
if(FXOS_CLEAN_LOGS)
|
||||
|
|
|
@ -33,14 +33,18 @@ requirements.
|
|||
* flex (2.6.4)
|
||||
* CMake (3.15) and make (eg. 4.2.1)
|
||||
|
||||
There are two configure options:
|
||||
There are three configure options:
|
||||
|
||||
* `-DCMAKE_BUILD_TYPE=Debug|Release`: default is debug.
|
||||
* `-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 -DFXOS_CLEAN_LOGS=1
|
||||
% cmake -B build
|
||||
# -DCMAKE_BUILD_TYPE=Debug
|
||||
# -DCMAKE_INSTALL_PREFIX=$HOME/.local
|
||||
# -DFXOS_CLEAN_LOGS=1
|
||||
% make -C build -j$(nproc) install
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue