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:
parent
632d014afd
commit
a25f9a1507
@ -64,6 +64,7 @@ install(EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets" NAMESPACE ${INSTALL_CMAKE_EXP
|
|||||||
## Install some QtBase specific CMake files:
|
## Install some QtBase specific CMake files:
|
||||||
install(FILES
|
install(FILES
|
||||||
cmake/QtBuild.cmake
|
cmake/QtBuild.cmake
|
||||||
|
cmake/QtCompilerFlags.cmake
|
||||||
cmake/QtCompilerOptimization.cmake
|
cmake/QtCompilerOptimization.cmake
|
||||||
cmake/QtFeature.cmake
|
cmake/QtFeature.cmake
|
||||||
cmake/QtPlatformSupport.cmake
|
cmake/QtPlatformSupport.cmake
|
||||||
|
6
cmake/QtCompilerFlags.cmake
Normal file
6
cmake/QtCompilerFlags.cmake
Normal 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()
|
@ -42,6 +42,9 @@ include(QtFeature)
|
|||||||
## Compiler optimization flags:
|
## Compiler optimization flags:
|
||||||
include(QtCompilerOptimization)
|
include(QtCompilerOptimization)
|
||||||
|
|
||||||
|
## Compiler flags:
|
||||||
|
include(QtCompilerFlags)
|
||||||
|
|
||||||
## Find host tools (if non native):
|
## Find host tools (if non native):
|
||||||
set(HOST_QT_TOOLS_DIRECTORY "" CACHE PATH "Directory with Qt host tools.")
|
set(HOST_QT_TOOLS_DIRECTORY "" CACHE PATH "Directory with Qt host tools.")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user