aboutsummaryrefslogtreecommitdiffstats
path: root/doc/howtos.qdoc
diff options
context:
space:
mode:
Diffstat (limited to 'doc/howtos.qdoc')
-rw-r--r--doc/howtos.qdoc32
1 files changed, 32 insertions, 0 deletions
diff --git a/doc/howtos.qdoc b/doc/howtos.qdoc
index d216ea004..a4252134d 100644
--- a/doc/howtos.qdoc
+++ b/doc/howtos.qdoc
@@ -48,6 +48,7 @@
\li \l{How do I build against libraries that provide pkg-config files?}
\li \l{How do I create application bundles and frameworks on iOS, macOS, tvOS, and watchOS?}
\li \l{How do I apply C/C++ preprocessor macros to only a subset of the files in my product?}
+ \li \l{How do I disable a compiler warning?}
\li \l{How do I make the state of my Git repository available to my source files?}
\li \l{How do I limit the number of concurrent jobs for the linker only?}
\li \l{How do I add QML files to a project?}
@@ -521,6 +522,37 @@
}
\endcode
+ \section1 How do I disable a compiler warning?
+
+ You can use the \l {cpp::commonCompilerFlags}{cpp.commonCompilerFlags} property
+ to pass flags to the compiler. For example, to disable deprecation warnings:
+
+ \code
+ CppApplication {
+ // ...
+
+ readonly property bool isMsvc: qbs.toolchain.contains("msvc")
+
+ cpp.commonCompilerFlags: isMsvc ? "/wd4996" : "-Wno-deprecated-declarations"
+ }
+ \endcode
+
+ It is also possible to disable all warnings at once by setting the
+ \l {cpp::commonCompilerFlags}{cpp.warningLevel} property to \c "none".
+ Usually this approach is discouraged, but it can be useful in some cases,
+ such as when compiling third party code:
+
+ \code
+ Group {
+ cpp.warningLevel: "none"
+
+ files: [
+ "3rdparty.h",
+ "3rdparty.cpp"
+ ]
+ }
+ \endcode
+
\section1 How do I make the state of my Git repository available to my source files?
Add a dependency to the \l{vcs} module to your product: