mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-13 17:47:49 +08:00
Merge topic 'clang-compiler-warnings'
88e56c2e5a
Enable compiler warnings when compiling CMake with Clangcadf2b632e
Fix -Wpessimizing-move warnings in QCMake::loadPresets() Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6252
This commit is contained in:
@@ -812,8 +812,12 @@ CMAKE_SETUP_TESTING()
|
||||
|
||||
if(NOT CMake_TEST_EXTERNAL_CMAKE)
|
||||
if(NOT CMake_VERSION_IS_RELEASE)
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND
|
||||
NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS 4.2)
|
||||
if((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND
|
||||
NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS 4.2) OR
|
||||
(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND
|
||||
NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS 3.0 AND
|
||||
NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC") OR
|
||||
CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
|
||||
set(C_FLAGS_LIST -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts
|
||||
-Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security
|
||||
-Wmissing-format-attribute -fno-common -Wundef
|
||||
|
@@ -550,17 +550,14 @@ void QCMake::loadPresets()
|
||||
}
|
||||
|
||||
QCMakePreset preset;
|
||||
preset.name = std::move(QString::fromLocal8Bit(p.Name.data()));
|
||||
preset.displayName =
|
||||
std::move(QString::fromLocal8Bit(p.DisplayName.data()));
|
||||
preset.description =
|
||||
std::move(QString::fromLocal8Bit(p.Description.data()));
|
||||
preset.generator = std::move(QString::fromLocal8Bit(p.Generator.data()));
|
||||
preset.architecture =
|
||||
std::move(QString::fromLocal8Bit(p.Architecture.data()));
|
||||
preset.name = QString::fromLocal8Bit(p.Name.data());
|
||||
preset.displayName = QString::fromLocal8Bit(p.DisplayName.data());
|
||||
preset.description = QString::fromLocal8Bit(p.Description.data());
|
||||
preset.generator = QString::fromLocal8Bit(p.Generator.data());
|
||||
preset.architecture = QString::fromLocal8Bit(p.Architecture.data());
|
||||
preset.setArchitecture = !p.ArchitectureStrategy ||
|
||||
p.ArchitectureStrategy == cmCMakePresetsFile::ArchToolsetStrategy::Set;
|
||||
preset.toolset = std::move(QString::fromLocal8Bit(p.Toolset.data()));
|
||||
preset.toolset = QString::fromLocal8Bit(p.Toolset.data());
|
||||
preset.setToolset = !p.ToolsetStrategy ||
|
||||
p.ToolsetStrategy == cmCMakePresetsFile::ArchToolsetStrategy::Set;
|
||||
preset.enabled = it.Expanded && it.Expanded->ConditionResult &&
|
||||
|
Reference in New Issue
Block a user