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

Teach CMake AUTOMOC to use a target's CXX language version for the generation of moc predefines file

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 6.5.0 Beta2
    • Build System: CMake

      CMake's AUTOMOC generates a moc_predefs.h file that it then passes to moc invocations.

      That file is generated by calling the CMAKE_CXX_COMPILER_PREDEFINES_COMMAND
      which looks something like:

      /usr/bin/c++ -dM -E -c <cmake_install_dir>/Modules/CMakeCXXCompilerABI.cpp
      

      This compiler invocation is missing the c++ standard version flag, which can influence the list of predefined defines.

      CMake should be fixed to pass the target's specified c++ std version to the predefines command.

      Original implementation of predefine generation was done at https://gitlab.kitware.com/cmake/cmake/-/merge_requests/1328/diffs

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

            orkun.tokdemir Orkun Tokdemir
            alexandru.croitor Alexandru Croitor
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 week
                1w

                  There are no open Gerrit changes