From 42869bc389e66519787bde755052b595457a8838 Mon Sep 17 00:00:00 2001 From: Tony Barbour Date: Thu, 5 Feb 2015 14:14:33 -0700 Subject: [PATCH] misc:Fixes to get better behavior in release builds Add -fno-strict-aliasing -fno-builtin-memcmp - Both of these are used by the Mesa driver, and without the first one, we hang? in link_shaders on release builds Move cube's LoadTexture out of an assert so it isn't skipped in release builds --- CMakeLists.txt | 1 + demos/cube.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e11532..67ef772 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,7 @@ include(FindPkgConfig) if (CMAKE_COMPILER_IS_GNUCC) set(COMMON_COMPILE_FLAGS "-Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-missing-field-initializers") + set(COMMON_COMPILE_FLAGS "${COMMON_COMPILE_FLAGS} -fno-strict-aliasing -fno-builtin-memcmp") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 ${COMMON_COMPILE_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_COMPILE_FLAGS}") if (UNIX) diff --git a/demos/cube.c b/demos/cube.c index fdd300c..00951b5 100644 --- a/demos/cube.c +++ b/demos/cube.c @@ -714,7 +714,8 @@ static void demo_prepare_textures(struct demo *demo) .borderColorType = XGL_BORDER_COLOR_OPAQUE_WHITE, }; - assert(loadTexture(tex_files[i], NULL, NULL, &tex_width, &tex_height)); + err = loadTexture(tex_files[i], NULL, NULL, &tex_width, &tex_height); + assert(err); const XGL_IMAGE_CREATE_INFO image = { .sType = XGL_STRUCTURE_TYPE_IMAGE_CREATE_INFO, -- 2.7.4