From d809a42c002df2c88a72a5024978f9bcb8feecc0 Mon Sep 17 00:00:00 2001 From: Quintus Date: Fri, 29 Jul 2016 12:38:01 +0200 Subject: Fix glew build problems. Cf. upstream ticket at . --- src/cegui-find-glew32.patch | 17 ----------------- src/cegui-fix-linking-order.patch | 19 +++++++++++++++++++ src/cegui.mk | 7 ++++--- 3 files changed, 23 insertions(+), 20 deletions(-) delete mode 100644 src/cegui-find-glew32.patch create mode 100644 src/cegui-fix-linking-order.patch diff --git a/src/cegui-find-glew32.patch b/src/cegui-find-glew32.patch deleted file mode 100644 index 8f76d2c..0000000 --- a/src/cegui-find-glew32.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- cmake/FindGLEW.cmake.orig 2016-07-19 14:11:06.255586305 +0200 -+++ cmake/FindGLEW.cmake 2016-07-19 14:11:35.454653035 +0200 -@@ -4,12 +4,12 @@ - include(FindPackageHandleStandardArgs) - - find_path(GLEW_H_PATH NAMES GL/glew.h) --find_library(GLEW_LIB NAMES GLEW libGLEW glew libglew PATH_SUFFIXES dynamic) -+find_library(GLEW_LIB NAMES glew32 GLEW libGLEW glew libglew PATH_SUFFIXES dynamic) - find_library(GLEW_LIB_DBG NAMES GLEW_d libGLEW_d glew_d libglew_d PATH_SUFFIXES dynamic) - mark_as_advanced(GLEW_H_PATH GLEW_LIB GLEW_LIB_DBG) - - if (WIN32 OR APPLE) -- find_library(GLEW_LIB_STATIC NAMES GLEW libGLEW glew libglew PATH_SUFFIXES static) -+ find_library(GLEW_LIB_STATIC NAMES glew32 GLEW libGLEW glew libglew PATH_SUFFIXES static) - find_library(GLEW_LIB_STATIC_DBG NAMES GLEW_d libGLEW_d glew_d libglew_d PATH_SUFFIXES static) - mark_as_advanced(GLEW_LIB_STATIC GLEW_LIB_STATIC_DBG) - endif() diff --git a/src/cegui-fix-linking-order.patch b/src/cegui-fix-linking-order.patch new file mode 100644 index 0000000..2f43ff1 --- /dev/null +++ b/src/cegui-fix-linking-order.patch @@ -0,0 +1,19 @@ +# Fix linking order. +# +# Fixed upstream since commit bf699651740a1206c9ce214b91426db1e709ddc4, +# which was after version 0.8.7, so remove this patch when upgrading to +# version 0.8.8 or newer. +# See: https://bitbucket.org/cegui/cegui/issues/1131/opengl-renderers-fail-to-crosscompile-due +--- old/cegui/src/RendererModules/OpenGL/CMakeLists.txt 2016-04-23 20:19:40.000000000 +0200 ++++ new/cegui/src/RendererModules/OpenGL/CMakeLists.txt 2016-07-29 11:58:25.062131930 +0200 +@@ -52,9 +52,9 @@ + cegui_add_dependency(${CEGUI_TARGET_NAME} GLM) + cegui_add_dependency(${CEGUI_TARGET_NAME} EPOXY) + elseif (${CEGUI_USE_GLEW}) +- cegui_add_dependency(${CEGUI_TARGET_NAME} OPENGL) + cegui_add_dependency(${CEGUI_TARGET_NAME} GLM) + cegui_add_dependency(${CEGUI_TARGET_NAME} GLEW PUBLIC) ++ cegui_add_dependency(${CEGUI_TARGET_NAME} OPENGL) + endif () + + cegui_target_link_libraries(${CEGUI_TARGET_NAME} ${CEGUI_BASE_LIBNAME}) diff --git a/src/cegui.mk b/src/cegui.mk index 77463b5..4f97036 100644 --- a/src/cegui.mk +++ b/src/cegui.mk @@ -27,12 +27,13 @@ endef # define GLEW_STATIC, but this is not completed yet (still gives "_imp__" # errors on glew). # cd '$(1)' && $(PATCH) < $(TOP_DIR)/src/cegui-find-glew32.patch +# -DCMAKE_CXX_FLAGS="$($(PKG)_CXXFLAGS) $(shell $(TARGET)-pkg-config --cflags freetype2 glew freeimage)" define $(PKG)_BUILD mkdir '$(1)/build' - $(PATCH) '$(1)/cmake/FindGLEW.cmake' '$(TOP_DIR)/src/cegui-find-glew32.patch' - cd '$(1)/build' && cmake .. \ + $(PATCH) -d '$(1)' -p1 < '$(TOP_DIR)/src/cegui-fix-linking-order.patch' + cd '$(1)/build' && export CXXFLAGS="$($(PKG)_CXXFLAGS) $(shell $(TARGET)-pkg-config --cflags freetype2 glew freeimage)" \ + && cmake .. \ -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \ - -DCMAKE_CXX_FLAGS="$($(PKG)_CXXFLAGS) $(shell $(TARGET)-pkg-config --cflags freetype2 glew freeimage)" \ -DCEGUI_BUILD_STATIC_CONFIGURATION=$(if $(BUILD_STATIC),true,false) \ -DCEGUI_SAMPLES_ENABLED=OFF \ -DCEGUI_BUILD_TESTS=OFF \ -- cgit v0.12