cmake: Start adding compiler flags

Only has warnings for now

Next to come is the support for developer-build and enabling Werror

Change-Id: I8070dc06eb439c2a03007cce975c8147ff7e1582
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
This commit is contained in:
Albert Astals Cid 2019-02-19 17:37:30 +01:00
parent 632d014afd
commit a25f9a1507
3 changed files with 10 additions and 0 deletions

View File

@ -64,6 +64,7 @@ install(EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets" NAMESPACE ${INSTALL_CMAKE_EXP
## Install some QtBase specific CMake files:
install(FILES
cmake/QtBuild.cmake
cmake/QtCompilerFlags.cmake
cmake/QtCompilerOptimization.cmake
cmake/QtFeature.cmake
cmake/QtPlatformSupport.cmake

View File

@ -0,0 +1,6 @@
# Set warnings. All compilers except MSVC support -Wall -Wextra
if (MSVC)
add_compile_options(/W3)
else()
add_compile_options(-Wall -Wextra)
endif()

View File

@ -42,6 +42,9 @@ include(QtFeature)
## Compiler optimization flags:
include(QtCompilerOptimization)
## Compiler flags:
include(QtCompilerFlags)
## Find host tools (if non native):
set(HOST_QT_TOOLS_DIRECTORY "" CACHE PATH "Directory with Qt host tools.")