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

FEATURE_cxx20 flag does not cause the code to be compiled with C++20

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • 6.8.1, 6.9.0 FF
    • 6.7.3
    • Build System: CMake
    • None
    • 674475887 (dev), c59649234 (6.8)

    Description

      Hi,

      when compiling the Qt conan recipie i noticed that the CXX_STANDARD was not set correctly, i tracked it down to the flag that was set to -DFEATURE_cxx20=ON,

      One way to fix it seems to be to set the -DQT_FEATURE_cxx20=on variable, but as far as i read in the code comments and documentation, users are supposed to use FEATURE_cxx20=ON.

       

      Reproducing it on windows:

      λ git clone git@github.com:qt/qtbase.git
      λ cd qtbase
      λ mkdir build
      λ cd build
      λ cmake.exe .. -DCMAKE_BUILD_TYPE=Release -G Ninja -DFEATURE_cxx20=ON
      -- The CXX compiler identification is MSVC 19.41.34123.0
      -- The C compiler identification is MSVC 19.41.34123.0
      -- The ASM compiler identification is MSVC
      -- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- CMAKE_BUILD_TYPE was already explicitly set to: 'Release'
                  -DCMAKE_C_FLAGS=/DWIN32 /D_WINDOWS
                  -DCMAKE_C_FLAGS_DEBUG=/Zi /Ob0 /Od /RTC1
                  -DCMAKE_C_FLAGS_RELEASE=/O2 /Ob2 /DNDEBUG
                  -DCMAKE_C_FLAGS_RELWITHDEBINFO=/Zi /O2 /Ob1 /DNDEBUG
                  -DCMAKE_CXX_FLAGS=/DWIN32 /D_WINDOWS /GR /EHsc
                  -DCMAKE_CXX_FLAGS_DEBUG=/Zi /Ob0 /Od /RTC1
                  -DCMAKE_CXX_FLAGS_RELEASE=/O2 /Ob2 /DNDEBUG
                  -DCMAKE_CXX_FLAGS_RELWITHDEBINFO=/Zi /O2 /Ob1 /DNDEBUG
                  -DCMAKE_EXE_LINKER_FLAGS=/machine:x64
                  -DCMAKE_C_STANDARD=11
                  -DCMAKE_C_STANDARD_REQUIRED=ON
                  -DCMAKE_CXX_STANDARD=17
                  -DCMAKE_CXX_STANDARD_REQUIRED=ON
                  -DCMAKE_MODULE_PATH:STRING=D:/dev/qtbase/cmake/platforms
      
      

      Note the DCMAKE_CXX_STANDARD=17, i would expect that this is 20 since i set `-DFEATURE_cxx20=ON`

      Thanks in Advance,

       

      Michael Wechner

      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
            mwechner Michael Wechner
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes