From 1462bfcd0b946a5678a0bad985d29db372c423b5 Mon Sep 17 00:00:00 2001 From: Vasco Correia Date: Sat, 15 Dec 2018 19:32:50 +0000 Subject: [PATCH] Fix Linux build process Update to use SDL2 2.0.9 Add `XML_DEV_RANDOM` flag to expath linux build Fix compilation error in `zl-gfx` --- cmake/cmake/third-party/expat/CMakeLists.txt | 4 ++++ cmake/cmake/third-party/sdl2/CMakeLists.txt | 4 ++-- src/zl-gfx/ZLGfxDevice.cpp | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cmake/cmake/third-party/expat/CMakeLists.txt b/cmake/cmake/third-party/expat/CMakeLists.txt index 2dd9cb7a31..4f3793b987 100644 --- a/cmake/cmake/third-party/expat/CMakeLists.txt +++ b/cmake/cmake/third-party/expat/CMakeLists.txt @@ -16,6 +16,10 @@ if ( BUILD_HTML ) set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_MEMMOVE=1 " ) endif ( BUILD_HTML ) +if ( BUILD_LINUX ) + set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_MEMMOVE=1 -DXML_DEV_URANDOM" ) +endif ( BUILD_LINUX ) + set ( EXPAT_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}" ) file ( GLOB_RECURSE EXPAT_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.c" ) diff --git a/cmake/cmake/third-party/sdl2/CMakeLists.txt b/cmake/cmake/third-party/sdl2/CMakeLists.txt index 6f85c3528b..54742a07e7 100644 --- a/cmake/cmake/third-party/sdl2/CMakeLists.txt +++ b/cmake/cmake/third-party/sdl2/CMakeLists.txt @@ -2,13 +2,13 @@ cmake_minimum_required ( VERSION 3.0 ) project ( SDL2-static ) include(ExternalProject) -set (SDL2_SOURCE_DIR "${MOAI_ROOT}/3rdparty/sdl2-2.0.4") +set (SDL2_SOURCE_DIR "${MOAI_ROOT}/3rdparty/sdl2-2.0.9") set (SDL2_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/binarydir") ExternalProject_Add(sdl2 SOURCE_DIR "${SDL2_SOURCE_DIR}" CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/install" -DSDL_SHARED=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DLIBC=ON CMAKE_CACHE_ARGS "-DSDL2_SOURCE_DIR:string=${SDL2_SOURCE_DIR}" "-DSDL2_BINARY_DIR:string=${SDL2_BINARY_DIR}" "-DSDL_STATIC:bool=on" "-DSDL_SHARED:bool=off" - PREFIX "${CMAKE_CURRENT_BINARY_DIR}/sdl2-2.0.4" + PREFIX "${CMAKE_CURRENT_BINARY_DIR}/sdl2-2.0.9" INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/install" ) diff --git a/src/zl-gfx/ZLGfxDevice.cpp b/src/zl-gfx/ZLGfxDevice.cpp index 409956b727..92287f6880 100644 --- a/src/zl-gfx/ZLGfxDevice.cpp +++ b/src/zl-gfx/ZLGfxDevice.cpp @@ -124,7 +124,7 @@ void ZLGfxDevice::Initialize () { // if framebuffer object is not in code, check to see if it's available as // an extension and remap to core function pointers if so - if (( isOpenGLES == false ) && ( majorVersion < 3 )) { + if (( isOpenGLES == false ) && ( sMajorVersion < 3 )) { if ( glewIsSupported ( "GL_EXT_framebuffer_object" )) {