Skip to content

chore(ci): testing ubuntu build in release mode

Raphael Defosseux requested to merge trying-release-mode-ubuntu into dev

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
    • So I set -DCMAKE_C_FLAGS_RELEASE="-O3" and -DCMAKE_CXX_FLAGS_RELEASE="-O3" to avoid the NDEBUG
    • This is true for the Ubuntu build and RHEL build
  • In CMakeLists.txt:
    • the tested variant shall be CMAKE_BUILD_TYPE and not default_build_type
      • And it is not needed to add -O3, already done by either CMAKE_{lang}_FLAGS_RELEASE_INIT or CMAKE_{lang}_FLAGS_RELEASE
    • -D_FORTIFY_SOURCE=3 is also set by default by gcc if -O3 is used, no need to redefine it
Edited by Raphael Defosseux

Merge request reports