Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-14865

Clang: Forward compiler options/flags to libclang

    XMLWordPrintable

Details

    Description

      Currently only the defines and include paths options are forwarded to libclang. Forwarding the other options from the project manager is important, too:

      • Warning options might help the user before invoking the build step.
      • Certain flags might set certain defines, which could be checked by headers in an unfavorable way, consider:
      qglobal.h
      ...
      #if !defined(QT_BOOTSTRAPPED) && defined(QT_REDUCE_RELOCATIONS) && defined(__ELF__) && \
          (!defined(__PIC__) || (defined(__PIE__) && defined(Q_CC_GNU) && Q_CC_GNU >= 500))
      #  error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\
               "Compile your code with -fPIC (-fPIE is not enough)."
      #endif
      ...
      

      The #error is problematic here.

      Check if we can switch to the "clang-cl" driver for libclang. Then we could even forward the options for msvc.

      Attachments

        Issue Links

          Activity

            People

              kosjar Nikolai Kosjar
              kosjar Nikolai Kosjar
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: