Fix compilation on GCC 8. Closes #984

This commit is contained in:
baldurk
2018-05-15 18:40:36 +01:00
parent 8c5e8081c5
commit d8a64c4172
6 changed files with 22 additions and 7 deletions
+1 -1
View File
@@ -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.
+3 -2
View File
@@ -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")
+7 -1
View File
@@ -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)
@@ -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()
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -1300,7 +1300,7 @@ int renderdoccmd(const GlobalEnvironment &env, std::vector<std::string> &argv)
clean_up();
return ret;
}
catch(std::exception e)
catch(std::exception &e)
{
fprintf(stderr, "Unexpected exception: %s\n", e.what());