-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add includemocs.py and create one moc file per cpp file #59230
Conversation
To reduce deviation from master and make future backporting easier, I'd propose to backport this too. |
Nice addition, for whatever reason, we now get warnings about unused private variables which were hidden before. |
🪟 Windows buildsDownload Windows builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm! will you resurrect the warnings as Error flag?
Thanks for the review @nyalldawson |
a6f19ab
to
afd266c
Compare
it warns erroneously about moc_include headers
@m-kuhn It still fails on my machine I compile with Ninja and ccache, should I delete my build folder and retry ? |
That's on a different file now (not the moc any more) Can you add this file to the list that you cited before: Lines 2183 to 2189 in 42a3bcf
|
diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt
index f64c6e76cb1..ed2f1ae7765 100644
--- a/src/app/CMakeLists.txt
+++ b/src/app/CMakeLists.txt
@@ -477,16 +477,21 @@ if(PEDANTIC)
endif()
if(MSVC)
-# -wd4091 Avoid 'typedef' ignored on left of '' when no variable is declared warning in dbghelp.h
-set_source_files_properties(
- qgisapp.cpp
- main.cpp
- qgscrashhandler.cpp
- PROPERTIES COMPILE_FLAGS -wd4091)
+ # -wd4091 Avoid 'typedef' ignored on left of '' when no variable is declared warning in dbghelp.h
+ set_source_files_properties(
+ qgisapp.cpp
+ main.cpp
+ qgscrashhandler.cpp
+ PROPERTIES COMPILE_FLAGS -wd4091
+ )
+ set_source_files_properties(
+ qgisapp.cpp
+ PROPERTIES COMPILE_FLAGS "/bigobj"
+ )
endif()
if(HAVE_OPENCL)
- include_directories(SYSTEM ${OpenCL_INCLUDE_DIRS})
+ include_directories(SYSTEM ${OpenCL_INCLUDE_DIRS})
endif()
if(ENABLE_MODELTEST) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 808540650d2..0c1ad171c11 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -2183,7 +2183,9 @@ endif()
if(MSVC)
set_source_files_properties(
${CMAKE_CURRENT_BINARY_DIR}/qgsexpression_texts.cpp
+ expression/qgsexpressionfunction.cpp
+ textrenderer/qgsfontmanager.cpp
proj/qgscoordinatereferencesystem.cpp
PROPERTIES COMPILE_FLAGS "/bigobj"
) It builds with theses diffs |
Please do (with or without formatting) |
This creates an include moc file per source file, which is supposed to improve build times for incremental builds and have a few other positive effects.
https://planet.kde.org/friedrich-kossebau-2023-06-28-include-also-moc-files-of-headers/
It should also help to fix the requirement for
/bigobj
in some environments (not sure about the exact conditions under which this is required)Copied from https://github.com/KDABLabs/KDToolBox/tree/master/qt/includemocs
Fixes #59157
What this does (reviewer guide)
scripts/includemocs.py
which can add moc include lines and detect missing ones (see link above for source)qt_add_cpp
calls, they are not needed with automoc in place