How to compile just a specific module from the qt source?
-
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-qtwidgetsor 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.
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. -
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.@Christian-Ehrlicher If i modify a single line in any file inside
qtbase\src\widgets\kerneli need to recompile the entirewidgetsmodule? isn't possible somehow to recompile just thekernelfolder? -
@Christian-Ehrlicher If i modify a single line in any file inside
qtbase\src\widgets\kerneli need to recompile the entirewidgetsmodule? isn't possible somehow to recompile just thekernelfolder?@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.
-
@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.
@Christian-Ehrlicher Then im doing something wrong because its recompiling everything instead of just the modified file. I will delete everything and try again.
-
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?
I would use
ninja Widgetsbut it should be the same. I would guess you did not modify anything inside the source dir for this build directory but somewhere else. -
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.
-
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 constI 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.
-
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 constI 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.
-
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 compilemy 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 -
I found the cause of the errors, i compiled the new source using the
x86 Native Tools Command Prompt for VS 2022instead of the x64, it end up generating x32 exe.Whenever I modify a source file and call
ninja Widgetsto it get compiled, it get compiled quickly < 1min
afterward i'm callingnpm --install .to get the recompiled file copied from theqt-everywhere-src-6.4.0folder to theD:\Qt\DebugBut this task is taking a
lotof 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 .?