[Bf-blender-cvs] [decdd70dfd0] master: Deps: Add libraries needed for Software GL

Sergey Sharybin noreply at git.blender.org
Wed Oct 9 12:37:14 CEST 2019


Commit: decdd70dfd0704ceb38235880897f647dfcab5ac
Author: Sergey Sharybin
Date:   Wed Oct 9 12:36:40 2019 +0200
Branches: master
https://developer.blender.org/rBdecdd70dfd0704ceb38235880897f647dfcab5ac

Deps: Add libraries needed for Software GL

Only compiled on Linux.

===================================================================

M	build_files/build_environment/CMakeLists.txt
M	build_files/build_environment/cmake/harvest.cmake
A	build_files/build_environment/cmake/libglu.cmake
A	build_files/build_environment/cmake/mesa.cmake
M	build_files/build_environment/cmake/versions.cmake

===================================================================

diff --git a/build_files/build_environment/CMakeLists.txt b/build_files/build_environment/CMakeLists.txt
index e7590727822..c7d8de22890 100644
--- a/build_files/build_environment/CMakeLists.txt
+++ b/build_files/build_environment/CMakeLists.txt
@@ -158,4 +158,9 @@ if(UNIX)
   include(cmake/sqlite.cmake)
 endif()
 
+if(UNIX AND NOT APPLE)
+  include(cmake/libglu.cmake)
+  include(cmake/mesa.cmake)
+endif()
+
 include(cmake/harvest.cmake)
diff --git a/build_files/build_environment/cmake/harvest.cmake b/build_files/build_environment/cmake/harvest.cmake
index b10b413c39a..cc596b2c786 100644
--- a/build_files/build_environment/cmake/harvest.cmake
+++ b/build_files/build_environment/cmake/harvest.cmake
@@ -200,4 +200,9 @@ harvest(xvidcore/lib ffmpeg/lib "*.a")
 harvest(embree/include embree/include "*.h")
 harvest(embree/lib embree/lib "*.a")
 
+if(UNIX AND NOT APPLE)
+  harvest(libglu/lib mesa/lib "*.so*")
+  harvest(mesa/lib mesa/lib "*.so*")
+endif()
+
 endif()
diff --git a/build_files/build_environment/cmake/libglu.cmake b/build_files/build_environment/cmake/libglu.cmake
new file mode 100644
index 00000000000..d1b7647eca3
--- /dev/null
+++ b/build_files/build_environment/cmake/libglu.cmake
@@ -0,0 +1,40 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+set(LIBGLU_CFLAGS "-static-libgcc")
+set(LIBGLU_CXXFLAGS "-static-libgcc -static-libstdc++ -Bstatic -lstdc++ -Bdynamic -l:libstdc++.a")
+set(LIBGLU_LDFLAGS "-pthread -static-libgcc -static-libstdc++ -Bstatic -lstdc++ -Bdynamic -l:libstdc++.a")
+
+set(LIBGLU_EXTRA_FLAGS
+  CFLAGS=${LIBGLU_CFLAGS}
+  CXXFLAGS=${LIBGLU_CXXFLAGS}
+  LDFLAGS=${LIBGLU_LDFLAGS}
+)
+
+ExternalProject_Add(external_libglu
+  URL ${LIBGLU_URI}
+  DOWNLOAD_DIR ${DOWNLOAD_DIR}
+  URL_HASH MD5=${LIBGLU_HASH}
+  PREFIX ${BUILD_DIR}/libglu
+  CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
+    cd ${BUILD_DIR}/libglu/src/external_libglu/ &&
+    ${CONFIGURE_COMMAND_NO_TARGET} --prefix=${LIBDIR}/libglu ${LIBGLU_EXTRA_FLAGS}
+  BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/libglu/src/external_libglu/ && make -j${MAKE_THREADS}
+  INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/libglu/src/external_libglu/ && make install
+  INSTALL_DIR ${LIBDIR}/libglu
+)
diff --git a/build_files/build_environment/cmake/mesa.cmake b/build_files/build_environment/cmake/mesa.cmake
new file mode 100644
index 00000000000..77fd8953fa0
--- /dev/null
+++ b/build_files/build_environment/cmake/mesa.cmake
@@ -0,0 +1,54 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+set(MESA_CFLAGS "-static-libgcc")
+set(MESA_CXXFLAGS "-static-libgcc -static-libstdc++ -Bstatic -lstdc++ -Bdynamic -l:libstdc++.a")
+set(MESA_LDFLAGS "-L${LIBDIR}/zlib/lib -pthread -static-libgcc -static-libstdc++ -Bstatic -lstdc++ -Bdynamic -l:libstdc++.a -l:libz_pic.a")
+
+set(MESA_EXTRA_FLAGS
+  CFLAGS=${MESA_CFLAGS}
+  CXXFLAGS=${MESA_CXXFLAGS}
+  LDFLAGS=${MESA_LDFLAGS}
+  --enable-glx=gallium-xlib
+  --with-gallium-drivers=swrast
+  --disable-dri
+  --disable-gbm
+  --disable-egl
+  --disable-gles1
+  --disable-gles2
+  --disable-llvm-shared-libs
+  --with-llvm-prefix=${LIBDIR}/llvm/lib
+)
+
+ExternalProject_Add(external_mesa
+  URL ${MESA_URI}
+  DOWNLOAD_DIR ${DOWNLOAD_DIR}
+  URL_HASH MD5=${MESA_HASH}
+  PREFIX ${BUILD_DIR}/mesa
+  CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
+    cd ${BUILD_DIR}/mesa/src/external_mesa/ &&
+    ${CONFIGURE_COMMAND_NO_TARGET} --prefix=${LIBDIR}/mesa ${MESA_EXTRA_FLAGS}
+  BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/mesa/src/external_mesa/ && make -j${MAKE_THREADS}
+  INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/mesa/src/external_mesa/ && make install
+  INSTALL_DIR ${LIBDIR}/mesa
+)
+
+add_dependencies(
+  external_mesa
+  ll
+)
diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake
index 621ac6b8bb4..1c9e5c5a4f6 100644
--- a/build_files/build_environment/cmake/versions.cmake
+++ b/build_files/build_environment/cmake/versions.cmake
@@ -310,3 +310,11 @@ set(EMBREE_HASH 3d4a1147002ff43939d45140aa9d6fb8)
 set(OIDN_VERSION 1.0.0)
 set(OIDN_URI https://github.com/OpenImageDenoise/oidn/releases/download/v${OIDN_VERSION}/oidn-${OIDN_VERSION}.src.zip)
 set(OIDN_HASH 19fe67b0164e8f020ac8a4f520defe60)
+
+set(LIBGLU_VERSION 9.0.1)
+set(LIBGLU_URI ftp://ftp.freedesktop.org/pub/mesa/glu/glu-${LIBGLU_VERSION}.tar.xz)
+set(LIBGLU_HASH 151aef599b8259efe9acd599c96ea2a3)
+
+set(MESA_VERSION 18.3.1)
+set(MESA_URI ftp://ftp.freedesktop.org/pub/mesa//mesa-${MESA_VERSION}.tar.xz)
+set(MESA_HASH d60828056d77bfdbae0970f9b15fb1be)



More information about the Bf-blender-cvs mailing list