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

EXPORT_MACRO option has no effect in qt_add_protobuf call

    XMLWordPrintable

Details

    • ae2f1ed3d (dev), 6671df0fb (6.7)

    Description

      When using the EXPORT_MACRO it's expected that the custom macro name will be used for C++ export macros

      cmake_minimum_required(VERSION 3.16)
      
      find_package(Qt6 COMPONENTS Protobuf Grpc)
      
      qt_add_protobuf(my_test PROTO_FILES test.proto EXPORT_MACRO "NOT_MY_TEST")
      

      Actual result:

      /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */
      
      #if defined(QT_SHARED) || !defined(QT_STATIC)
      #  if defined(QT_BUILD_MY_TEST_LIB)
      #    define QPB_MY_TEST_EXPORT Q_DECL_EXPORT
      #  else
      #    define QPB_MY_TEST_EXPORT Q_DECL_IMPORT
      #  endif
      #else
      #  define QPB_MY_TEST_EXPORT
      #endif
      
      

      Expected result:

      /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */
      
      #if defined(QT_SHARED) || !defined(QT_STATIC)
      #  if defined(QT_BUILD_NOT_MY_TEST_LIB)
      #    define QPB_NOT_MY_TEST_EXPORT Q_DECL_EXPORT
      #  else
      #    define QPB_NOT_MY_TEST_EXPORT Q_DECL_IMPORT
      #  endif
      #else
      #  define QPB_NOT_MY_TEST_EXPORT
      #endif
      
      

      Attachments

        For Gerrit Dashboard: QTBUG-121854
        # Subject Branch Project Status CR V

        Activity

          People

            semlanik Alexey Edelev
            semlanik Alexey Edelev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes