diff --git a/CMakeLists.txt b/CMakeLists.txt index f6de54d97..8c2819f5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -213,7 +213,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") -Wno-unknown-pragmas -Wno-reorder) if(CMAKE_COMPILER_IS_GNUCXX) - list(APPEND warning_flags -Wno-unused-but-set-variable -Wno-maybe-uninitialized) + list(APPEND warning_flags -Wno-unused-but-set-variable -Wno-maybe-uninitialized -Wno-class-memaccess) # We keep the implicit fallthrough warning for now, but allow more # comments to silence it. diff --git a/qrenderdoc/CMakeLists.txt b/qrenderdoc/CMakeLists.txt index a3dab7f81..36afa729f 100644 --- a/qrenderdoc/CMakeLists.txt +++ b/qrenderdoc/CMakeLists.txt @@ -125,13 +125,14 @@ file(WRITE "\n" "OSX_ICONFILE=${CMAKE_CURRENT_BINARY_DIR}/RenderDoc.icns\n") -# propagate build version info. Lots of escaping needed here to pass ""s into the define value +# Ignore warnings - qmake has no way to do this per-file, so we must do it globally if(CMAKE_COMPILER_IS_GNUCXX) file(APPEND ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri - "QMAKE_CXXFLAGS+=-Wno-unknown-warning -Wno-implicit-fallthrough\n") + "QMAKE_CXXFLAGS+=-Wno-unknown-warning -Wno-implicit-fallthrough -Wno-cast-function-type -Wno-stringop-truncation\n") endif() +# propagate build version info. Lots of escaping needed here to pass ""s into the define value file(APPEND ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri "DEFINES+=GIT_COMMIT_HASH='\\\\\"${GIT_COMMIT_HASH}\\\\\"'\n") diff --git a/qrenderdoc/Code/pyrenderdoc/CMakeLists.txt b/qrenderdoc/Code/pyrenderdoc/CMakeLists.txt index 8ba8c950b..dd5dff2cc 100644 --- a/qrenderdoc/Code/pyrenderdoc/CMakeLists.txt +++ b/qrenderdoc/Code/pyrenderdoc/CMakeLists.txt @@ -15,7 +15,13 @@ set(MODULE_INCLUDES set(MODULE_DEFINES PRIVATE -DRENDERDOC_PLATFORM_LINUX) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option -Wno-unused-private-field") +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option -Wno-unused-private-field") +endif() + +if(CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-cast-function-type -Wno-stringop-truncation") +endif() # Set up rpath to find librenderdoc.so set(CMAKE_SKIP_BUILD_RPATH TRUE) diff --git a/renderdoc/driver/shaders/spirv/CMakeLists.txt b/renderdoc/driver/shaders/spirv/CMakeLists.txt index 2664b1375..8ee73e4db 100644 --- a/renderdoc/driver/shaders/spirv/CMakeLists.txt +++ b/renderdoc/driver/shaders/spirv/CMakeLists.txt @@ -97,9 +97,17 @@ add_definitions(-DAMD_EXTENSIONS) add_definitions(-DNV_EXTENSIONS) set_source_files_properties(${glslang_sources} - PROPERTIES COMPILE_FLAGS "-Wno-ignored-qualifiers -Wno-unknown-warning-option -Wno-inconsistent-missing-override") + PROPERTIES COMPILE_FLAGS "-Wno-ignored-qualifiers") + +if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0) + set_source_files_properties(${glslang_dir}/glslang/MachineIndependent/reflection.cpp + PROPERTIES COMPILE_FLAGS "-Wno-implicit-fallthrough -Wno-ignored-qualifiers") +endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set_property(SOURCE "${glslang_sources}" + APPEND PROPERTY COMPILE_FLAGS "-Wno-unknown-warning-option -Wno-inconsistent-missing-override") + set_source_files_properties(${glslang_dir}/SPIRV/GlslangToSpv.cpp PROPERTIES COMPILE_FLAGS "-Wno-tautological-constant-out-of-range-compare") endif() diff --git a/renderdoc/os/posix/posix_stringio.cpp b/renderdoc/os/posix/posix_stringio.cpp index d68bcfdb7..1fa2ce496 100644 --- a/renderdoc/os/posix/posix_stringio.cpp +++ b/renderdoc/os/posix/posix_stringio.cpp @@ -222,7 +222,7 @@ void GetDefaultFiles(const char *logBaseName, string &capture_filename, string & temp_folder[--len] = 0; } - char temp_filename[2048] = {0}; + char temp_filename[2048 + 128] = {0}; snprintf(temp_filename, sizeof(temp_filename) - 1, "%s/RenderDoc/%s_%04d.%02d.%02d_%02d.%02d.rdc", temp_folder, mod, 1900 + now.tm_year, now.tm_mon + 1, now.tm_mday, now.tm_hour, diff --git a/renderdoccmd/renderdoccmd.cpp b/renderdoccmd/renderdoccmd.cpp index 16c059c5a..bf9da1180 100644 --- a/renderdoccmd/renderdoccmd.cpp +++ b/renderdoccmd/renderdoccmd.cpp @@ -1300,7 +1300,7 @@ int renderdoccmd(const GlobalEnvironment &env, std::vector &argv) clean_up(); return ret; } - catch(std::exception e) + catch(std::exception &e) { fprintf(stderr, "Unexpected exception: %s\n", e.what());