diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d8f7e6..858d32a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}/= + $<$:-O0> $<$:-g> + $<$:-O2>) + # Diagnostic options to clean up output a little bit if(FXOS_CLEAN_LOGS) diff --git a/README.md b/README.md index e3e5d2a..9767447 100644 --- a/README.md +++ b/README.md @@ -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=`: 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 ```