Disable Clang "-Wshorten-64-to-32" for files

3rdParty source files and some renderdoc files which include 3rdparty header files

Disable "-Wshorten-64-to-32" for the whole of qrenderdoc render_python.cxx triggers the warning
This commit is contained in:
Jake Turner
2022-07-18 20:45:52 +01:00
committed by Baldur Karlsson
parent 0d02425a87
commit fb04266122
5 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -214,7 +214,7 @@ endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
file(APPEND
${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
"QMAKE_CXXFLAGS+=-Wno-shadow\n")
"QMAKE_CXXFLAGS+=-Wno-shadow -Wno-shorten-64-to-32\n")
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.9)
+1 -1
View File
@@ -17,7 +17,7 @@ set(MODULE_DEFINES
PRIVATE -DRENDERDOC_PLATFORM_LINUX)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option -Wno-unused-private-field -Wno-shadow")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option -Wno-unused-private-field -Wno-shadow -Wno-shorten-64-to-32")
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
+4 -1
View File
@@ -400,7 +400,10 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR APPLE)
# -Wno-unused-lambda-capture available
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set_property(SOURCE 3rdparty/jpeg-compressor/jpgd.cpp
APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-unreachable-code-break -Wno-implicit-fallthrough -Wno-shadow")
APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-unreachable-code-break -Wno-implicit-fallthrough -Wno-shadow -Wno-shorten-64-to-32")
set_property(SOURCE 3rdparty/jpeg-compressor/jpge.cpp
APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-shorten-64-to-32")
# Only clang has this warning. Fixing it in this file causes a compile error on windows
set_source_files_properties(os/os_specific.cpp
@@ -135,7 +135,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
spirv_debug_glsl450.cpp
spirv_debug_setup.cpp
spirv_processor.cpp
APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-shadow")
APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-shadow -Wno-shorten-64-to-32")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.9)
set_property(SOURCE ${glslang_dir}/glslang/MachineIndependent/iomapper.cpp
+1 -1
View File
@@ -86,7 +86,7 @@ set(VULKAN_LAYER_FOLDER ${VULKAN_LAYER_FOLDER_DEFAULT} CACHE PATH "Path to insta
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set_property(SOURCE vk_shaderdebug.cpp
APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-shadow")
APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-shadow -Wno-shorten-64-to-32")
endif()
if(ANDROID)