The expiration time for new job artifacts in CI/CD pipelines is now 30 days (GitLab default). Previously generated artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

Commit 3d7df867 authored by Jakob Weiss's avatar Jakob Weiss
Browse files

Multiple bugfixes concerning platform compat

* FindTBB now reports errors slightly more robustly
* fixed compiler option specification for campvis-application
* fixed minor warning in multiindexedgeometry
* On systems with too low OpenGL support, application reports supported GL version BEFORE crashing if GL version is too low
parent c2259fe8
...@@ -274,15 +274,15 @@ if(NOT TBB_FOUND) ...@@ -274,15 +274,15 @@ if(NOT TBB_FOUND)
if(NOT CMAKE_VERSION VERSION_LESS 3.0 AND TBB_FOUND) if(NOT CMAKE_VERSION VERSION_LESS 3.0 AND TBB_FOUND)
add_library(tbb SHARED IMPORTED) add_library(tbb SHARED IMPORTED)
set_target_properties(tbb PROPERTIES set_target_properties(tbb PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${TBB_INCLUDE_DIRS} INTERFACE_INCLUDE_DIRECTORIES "${TBB_INCLUDE_DIRS}"
IMPORTED_LOCATION ${TBB_LIBRARIES}) IMPORTED_LOCATION "${TBB_LIBRARIES}")
if(TBB_LIBRARIES_RELEASE AND TBB_LIBRARIES_DEBUG) if(TBB_LIBRARIES_RELEASE AND TBB_LIBRARIES_DEBUG)
set_target_properties(tbb PROPERTIES set_target_properties(tbb PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "$<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:TBB_USE_DEBUG=1>" INTERFACE_COMPILE_DEFINITIONS "$<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:TBB_USE_DEBUG=1>"
IMPORTED_LOCATION_DEBUG ${TBB_LIBRARIES_DEBUG} IMPORTED_LOCATION_DEBUG "${TBB_LIBRARIES_DEBUG}"
IMPORTED_LOCATION_RELWITHDEBINFO ${TBB_LIBRARIES_DEBUG} IMPORTED_LOCATION_RELWITHDEBINFO "${TBB_LIBRARIES_DEBUG}"
IMPORTED_LOCATION_RELEASE ${TBB_LIBRARIES_RELEASE} IMPORTED_LOCATION_RELEASE "${TBB_LIBRARIES_RELEASE}"
IMPORTED_LOCATION_MINSIZEREL ${TBB_LIBRARIES_RELEASE} IMPORTED_LOCATION_MINSIZEREL "${TBB_LIBRARIES_RELEASE}"
) )
elseif(TBB_LIBRARIES_RELEASE) elseif(TBB_LIBRARIES_RELEASE)
set_target_properties(tbb PROPERTIES IMPORTED_LOCATION ${TBB_LIBRARIES_RELEASE}) set_target_properties(tbb PROPERTIES IMPORTED_LOCATION ${TBB_LIBRARIES_RELEASE})
......
...@@ -178,7 +178,7 @@ IF(WIN32) ...@@ -178,7 +178,7 @@ IF(WIN32)
ELSEIF(UNIX) ELSEIF(UNIX)
LIST(APPEND CampvisGlobalDefinitions "-DUNIX") LIST(APPEND CampvisGlobalDefinitions "-DUNIX")
LIST(APPEND CampvisGlobalDefinitions "-Wall -Wno-unused-local-typedefs -Wno-unused-variable -Wno-unknown-pragmas -Wno-overloaded-virtual") LIST(APPEND CampvisGlobalDefinitions -Wall -Wno-unused-local-typedefs -Wno-unused-variable -Wno-unknown-pragmas -Wno-overloaded-virtual)
LIST(APPEND CampvisGlobalDefinitions "-D__STDC_CONSTANT_MACROS") LIST(APPEND CampvisGlobalDefinitions "-D__STDC_CONSTANT_MACROS")
# dangerous! # dangerous!
......
...@@ -221,7 +221,7 @@ namespace campvis { ...@@ -221,7 +221,7 @@ namespace campvis {
} }
// normalize the accumulated normal // normalize the accumulated normal
for (int i = 0; i < _normals.size(); i++) { for (size_t i = 0; i < _normals.size(); i++) {
_normals[i] = cgt::normalize(_normals[i]); _normals[i] = cgt::normalize(_normals[i]);
} }
......
...@@ -120,7 +120,7 @@ namespace campvis { ...@@ -120,7 +120,7 @@ namespace campvis {
std::this_thread::yield(); std::this_thread::yield();
// set the QGLContext's thread affinity // set the QGLContext's thread affinity
canvas->moveThreadAffinity(targetThread); canvas->moveThreadAffinity(const_cast<void*>(targetThread));
// reset the signal variable so that the new thread can continue. // reset the signal variable so that the new thread can continue.
targetThread = nullptr; targetThread = nullptr;
......
...@@ -56,7 +56,7 @@ namespace cgt { ...@@ -56,7 +56,7 @@ namespace cgt {
// Init GLEW for this context // Init GLEW for this context
context->acquireAsCurrentContext(); context->acquireAsCurrentContext();
glewExperimental=true; // required in case an old glew version is used glewExperimental = GL_TRUE; // required in case an old glew version is used
GLenum err = glewInit(); GLenum err = glewInit();
if (err != GLEW_OK) { if (err != GLEW_OK) {
// Problem: glewInit failed, something is seriously wrong. // Problem: glewInit failed, something is seriously wrong.
......
...@@ -278,9 +278,6 @@ void GpuCapabilities::detectCapabilities() { ...@@ -278,9 +278,6 @@ void GpuCapabilities::detectCapabilities() {
glVendorString_ = string(reinterpret_cast<const char*>(glGetString(GL_VENDOR))); glVendorString_ = string(reinterpret_cast<const char*>(glGetString(GL_VENDOR)));
glRendererString_ = string(reinterpret_cast<const char*>(glGetString(GL_RENDERER))); glRendererString_ = string(reinterpret_cast<const char*>(glGetString(GL_RENDERER)));
queryExtensions();
// Prevent segfault // Prevent segfault
const char* glslVS = reinterpret_cast<const char*>(glGetString(GL_SHADING_LANGUAGE_VERSION)); const char* glslVS = reinterpret_cast<const char*>(glGetString(GL_SHADING_LANGUAGE_VERSION));
if (glslVS) if (glslVS)
...@@ -305,6 +302,8 @@ void GpuCapabilities::detectCapabilities() { ...@@ -305,6 +302,8 @@ void GpuCapabilities::detectCapabilities() {
vendor_ = GPU_VENDOR_UNKNOWN; vendor_ = GPU_VENDOR_UNKNOWN;
} }
queryExtensions();
// Shaders // Shaders
shaderSupport_ = (glVersion_ >= GlVersion::CGT_GL_VERSION_2_0); shaderSupport_ = (glVersion_ >= GlVersion::CGT_GL_VERSION_2_0);
shaderSupportARB_ = (isExtensionSupported("GL_ARB_vertex_program") && shaderSupportARB_ = (isExtensionSupported("GL_ARB_vertex_program") &&
...@@ -397,12 +396,14 @@ void GpuCapabilities::queryExtensions() ...@@ -397,12 +396,14 @@ void GpuCapabilities::queryExtensions()
glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions); glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions);
glExtensions_.resize(numExtensions); glExtensions_.resize(numExtensions);
for(int i = 0; i < numExtensions; ++i) { if(glGetStringi) {
const char* strPtr = reinterpret_cast<const char*>(glGetStringi(GL_EXTENSIONS, i)); for(int i = 0; i < numExtensions; ++i) {
if (strPtr && strPtr[0] != '\0') const char* strPtr = reinterpret_cast<const char*>(glGetStringi(GL_EXTENSIONS, i));
glExtensions_[i] = string(strPtr); if (strPtr && strPtr[0] != '\0')
else glExtensions_[i] = string(strPtr);
break; else
break;
}
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment