chore(ci): testing ubuntu build in release mode
Explanation of the CMakeLists.txt and Dockerfile modifications:
- Calling
cmake
with following options:-
-DCMAKE_BUILD_TYPE=Release
: by default:CMAKE_{lang}_FLAGS_RELEASE_INIT
is equal to-O3 -DNDEBUG
- I want to keep the
-O3
but remove the-DNDEBUG
to keep the assertions - You cannot override
CMAKE_{lang}_FLAGS_RELEASE_INIT
in the command line but
- I want to keep the
- So I set
-DCMAKE_C_FLAGS_RELEASE="-O3"
and-DCMAKE_CXX_FLAGS_RELEASE="-O3"
to avoid theNDEBUG
- This is true for the Ubuntu build and RHEL build
-
- In
CMakeLists.txt
:- the tested variant shall be
CMAKE_BUILD_TYPE
and notdefault_build_type
- And it is not needed to add
-O3
, already done by eitherCMAKE_{lang}_FLAGS_RELEASE_INIT
orCMAKE_{lang}_FLAGS_RELEASE
- And it is not needed to add
-
-D_FORTIFY_SOURCE=3
is also set by default by gcc if-O3
is used, no need to redefine it
- the tested variant shall be
Edited by Raphael Defosseux