Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to compile just a specific module from the qt source?
Forum Updated to NodeBB v4.3 + New Features

How to compile just a specific module from the qt source?

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 5 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Roberrt
    wrote on 10 Apr 2023, 11:50 last edited by Roberrt 4 Oct 2023, 12:28
    #1

    I have compiled the entire source from qt-everywhere-src-6.4.0, I'm testing some modifications i did in some files.
    How i could compile only the specific module in which I modified the files, instead of everything again?

    I'm compiling on Windows, what i have tried:

    configure.bat -debug -platform win32-msvc -opensource -confirm-license -prefix "D:\Qt\Debug" module-qtwidgets
    

    or do i need to just call:

    configure.bat -debug -platform win32-msvc -opensource -confirm-license -prefix "D:\Qt\Debug"
    

    then when it finish configuring, try to pass the module i need to recompile? I'm confused.

    C 1 Reply Last reply 10 Apr 2023, 15:31
    0
    • R Roberrt
      10 Apr 2023, 11:50

      I have compiled the entire source from qt-everywhere-src-6.4.0, I'm testing some modifications i did in some files.
      How i could compile only the specific module in which I modified the files, instead of everything again?

      I'm compiling on Windows, what i have tried:

      configure.bat -debug -platform win32-msvc -opensource -confirm-license -prefix "D:\Qt\Debug" module-qtwidgets
      

      or do i need to just call:

      configure.bat -debug -platform win32-msvc -opensource -confirm-license -prefix "D:\Qt\Debug"
      

      then when it finish configuring, try to pass the module i need to recompile? I'm confused.

      C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 10 Apr 2023, 15:31 last edited by
      #2

      Configure Qt and then go into the subdir you want to have to get recompiled (when you use NMake Makefiles) or simply tell ninja what module it should build (e.g. ninja Widgets) when you use Ninja.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      R 1 Reply Last reply 10 Apr 2023, 17:02
      0
      • C Christian Ehrlicher
        10 Apr 2023, 15:31

        Configure Qt and then go into the subdir you want to have to get recompiled (when you use NMake Makefiles) or simply tell ninja what module it should build (e.g. ninja Widgets) when you use Ninja.

        R Offline
        R Offline
        Roberrt
        wrote on 10 Apr 2023, 17:02 last edited by Roberrt 4 Oct 2023, 17:03
        #3

        @Christian-Ehrlicher If i modify a single line in any file inside qtbase\src\widgets\kernel i need to recompile the entire widgets module? isn't possible somehow to recompile just the kernel folder?

        C 1 Reply Last reply 10 Apr 2023, 17:07
        0
        • R Roberrt
          10 Apr 2023, 17:02

          @Christian-Ehrlicher If i modify a single line in any file inside qtbase\src\widgets\kernel i need to recompile the entire widgets module? isn't possible somehow to recompile just the kernel folder?

          C Offline
          C Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 10 Apr 2023, 17:07 last edited by
          #4

          @Roberrt said in How to compile just a specific module from the qt source?:

          ? isn't possible somehow to recompile just the kernel folder?

          I don't understand your question - every useful build system I'm aware of only re-builds the source files which were modified.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          R 1 Reply Last reply 10 Apr 2023, 17:12
          0
          • C Christian Ehrlicher
            10 Apr 2023, 17:07

            @Roberrt said in How to compile just a specific module from the qt source?:

            ? isn't possible somehow to recompile just the kernel folder?

            I don't understand your question - every useful build system I'm aware of only re-builds the source files which were modified.

            R Offline
            R Offline
            Roberrt
            wrote on 10 Apr 2023, 17:12 last edited by
            #5

            @Christian-Ehrlicher Then im doing something wrong because its recompiling everything instead of just the modified file. I will delete everything and try again.

            1 Reply Last reply
            0
            • R Offline
              R Offline
              Roberrt
              wrote on 10 Apr 2023, 18:17 last edited by Roberrt 4 Oct 2023, 18:17
              #6

              I have modified a kernel file and when i run

              D:\Qt\qt-everywhere-src-6.4.0>cmake --build . --target Widgets
              ninja: no work to do.
              

              It just say "no work to do" what im missing?

              C 1 Reply Last reply 10 Apr 2023, 18:20
              0
              • R Roberrt
                10 Apr 2023, 18:17

                I have modified a kernel file and when i run

                D:\Qt\qt-everywhere-src-6.4.0>cmake --build . --target Widgets
                ninja: no work to do.
                

                It just say "no work to do" what im missing?

                C Offline
                C Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on 10 Apr 2023, 18:20 last edited by
                #7

                I would use ninja Widgets but it should be the same. I would guess you did not modify anything inside the source dir for this build directory but somewhere else.

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 10 Apr 2023, 18:22 last edited by
                  #8

                  Hi,

                  The kernel subfolder is not a module in itself. Depending on what you modified there, there will likely be several classes that need to be rebuilt, possibly through several modules.

                  That said, if you are only working on the widgets module, you can simply build only qtbase.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • R Offline
                    R Offline
                    Roberrt
                    wrote on 10 Apr 2023, 18:33 last edited by Roberrt 4 Oct 2023, 20:02
                    #9

                    It worked after calling the configure command again

                    configure.bat -debug -platform win32-msvc -opensource -confirm-license -prefix "D:\Qt\Debug"
                    

                    But now i'm getting tons of compile errors like:

                    @HPEAPEAX@Z)
                    1>moc_MainWindow.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static struct QMetaObject const QMainWindow::staticMetaObject" (__imp_?staticMetaObject@QMainWindow@@2UQMetaObject@@B) referenced in function "public: static struct QMetaObject const * __cdecl QMetaObject::staticMetaObject<&public: static struct QMetaObject const
                    

                    I also tried rebuild solution/clean solution, still getting the errors.
                    I'm getting these errors on all existing projects i have.
                    When i create a new project i get no error.

                    I'm building on vs 2022.

                    JoeCFDJ 1 Reply Last reply 10 Apr 2023, 20:16
                    0
                    • R Roberrt
                      10 Apr 2023, 18:33

                      It worked after calling the configure command again

                      configure.bat -debug -platform win32-msvc -opensource -confirm-license -prefix "D:\Qt\Debug"
                      

                      But now i'm getting tons of compile errors like:

                      @HPEAPEAX@Z)
                      1>moc_MainWindow.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static struct QMetaObject const QMainWindow::staticMetaObject" (__imp_?staticMetaObject@QMainWindow@@2UQMetaObject@@B) referenced in function "public: static struct QMetaObject const * __cdecl QMetaObject::staticMetaObject<&public: static struct QMetaObject const
                      

                      I also tried rebuild solution/clean solution, still getting the errors.
                      I'm getting these errors on all existing projects i have.
                      When i create a new project i get no error.

                      I'm building on vs 2022.

                      JoeCFDJ Offline
                      JoeCFDJ Offline
                      JoeCFD
                      wrote on 10 Apr 2023, 20:16 last edited by
                      #10

                      @Roberrt
                      http://bin.ceicer.com/qt/Windows/Qt5.15.9_msvc_shared_64-bit/readme.txt
                      https://forum.qt.io/topic/144231/qt5-15-9-linux-and-windows-compiled-source-code?_=1681152916124

                      R 1 Reply Last reply 10 Apr 2023, 21:06
                      0
                      • L Offline
                        L Offline
                        Lightshadown
                        wrote on 10 Apr 2023, 20:58 last edited by
                        #11

                        Hi i got a similar situation but im compiling on rpi3, i did follow this tutorial tutorial rpi3 Qt, its posible to just compile and add a platform instead of recompile all the framework?, forgot to add -eglfs meabe something like
                        ./configure -eglfs ? is that posible or do i need to start all over from scracht, last time took me like 30h just to compile

                        my compile command was as follow

                        ../qt-everywhere-src-5.12.10/configure -platform linux-rpi-g++ \
                        -v \
                        -no-gtk \
                        -opensource -confirm-license -release \
                        -reduce-exports \
                        -force-pkg-config \
                        -nomake examples -no-compile-examples \
                        -skip qtwayland \
                        -skip qtwebengine \
                        -no-feature-geoservices_mapboxgl \
                        -qt-pcre \
                        -no-pch \
                        -ssl \
                        -evdev \
                        -system-freetype \
                        -fontconfig \
                        -glib \
                        -prefix /opt/Qt/5.12.10 \
                        -qpa eglfs
                        
                        1 Reply Last reply
                        0
                        • JoeCFDJ JoeCFD
                          10 Apr 2023, 20:16

                          @Roberrt
                          http://bin.ceicer.com/qt/Windows/Qt5.15.9_msvc_shared_64-bit/readme.txt
                          https://forum.qt.io/topic/144231/qt5-15-9-linux-and-windows-compiled-source-code?_=1681152916124

                          R Offline
                          R Offline
                          Roberrt
                          wrote on 10 Apr 2023, 21:06 last edited by Roberrt 4 Oct 2023, 21:43
                          #12

                          I found the cause of the errors, i compiled the new source using the x86 Native Tools Command Prompt for VS 2022 instead of the x64, it end up generating x32 exe.

                          Whenever I modify a source file and call ninja Widgets to it get compiled, it get compiled quickly < 1min
                          afterward i'm calling npm --install . to get the recompiled file copied from the qt-everywhere-src-6.4.0 folder to the D:\Qt\Debug

                          But this task is taking a lot of time, it is iterating through thousand files checking which are not updated:

                          -- Up-to-date: D:/Qt/Debug/include/QtDesigner/6.4.0/QtDesigner/private/qdesigner_formeditorcommand_p.h
                          -- Up-to-date: D:/Qt/Debug/include/QtDesigner/6.4.0/QtDesigner/private/qdesigner_formwindowcommand_p.h
                          -- Up-to-date: D:/Qt/Debug/include/QtDesigner/6.4.0/QtDesigner/private/qdesigner_formwindowmanager_p.h
                          -- Up-to-date: D:/Qt/Debug/include/QtDesigner/6.4.0/QtDesigner/private/qdesigner_introspection_p.h
                          -- Up-to-date: D:/Qt/Debug/include/QtDesigner/6.4.0/QtDesigner/private/qdesigner_membersheet_p.h
                          -- Up-to-date: D:/Qt/Debug/include/QtDesigner/6.4.0/QtDesigner/private/qdesigner_menu_p.h
                          ...
                          

                          Am i doing this correctly?
                          There's another way to copy directly the file that got modified/recompiled instead of checking one by one which the command --install .?

                          1 Reply Last reply
                          0

                          1/12

                          10 Apr 2023, 11:50

                          • Login

                          • Login or register to search.
                          1 out of 12
                          • First post
                            1/12
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved