Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-96451

CMake multi-config-ninja does not apply CMAKE_CXX_FLAGS to all targets

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 6.3
    • Build System: CMake
    • None

    Description

      Looks like the options I specify during the build with "CMAKE_CXX_FLAGS" aren't set in all targets. They appear to be used only for some .cpp sources, but not all.

      Configure:

      cmake $srcdir -G'Ninja Multi-Config' -DCMAKE_INSTALL_PREFIX=$PWD \
      -DCMAKE_DEFAULT_BUILD_TYPE:STRING=Debug \
      -DCMAKE_CONFIGURATION_TYPES:STRING='Release;RelWithDebInfo;Debug' \
      -DCMAKE_CXX_FLAGS:STRING='-march=tigerlake -mprefer-vector-width=256 -maes -mno-rdseed' \
      -DCMAKE_CXX_FLAGS_DEBUG:STRING='-O0 -g3' \
      -DCMAKE_C_FLAGS:STRING='-march=tigerlake -mprefer-vector-width=256 -maes -mno-rdseed' \
      -DCMAKE_C_FLAGS_DEBUG:STRING='-O0 -g' \
      -DCMAKE_C_FLAGS_RELEASE:STRING='-O3 -g1'
      [other options]
      

      Do note that the corresponding CMAKE_C_FLAGS are applied, so you will see it show up when building the C source files included as part of qtbase's build. The problem appears to be CMAKE_CXX_FLAGS and only in a multi-config build.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtbuildsystem Qt Build System Team
            thiago Thiago Macieira
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes