Loading
chore(ci): testing ubuntu build in release mode
Explanation of the CMakeLists.txt and Dockerfile modifications:
- Calling
cmakewith following options:-
-DCMAKE_BUILD_TYPE=Release: by default:CMAKE_{lang}_FLAGS_RELEASE_INITis equal to-O3 -DNDEBUG- I want to keep the
-O3but remove the-DNDEBUGto keep the assertions - You cannot override
CMAKE_{lang}_FLAGS_RELEASE_INITin 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_TYPEand notdefault_build_type- And it is not needed to add
-O3, already done by eitherCMAKE_{lang}_FLAGS_RELEASE_INITorCMAKE_{lang}_FLAGS_RELEASE
- And it is not needed to add
-
-D_FORTIFY_SOURCE=3is also set by default by gcc if-O3is used, no need to redefine it
- the tested variant shall be
Edited by Raphael Defosseux