commit 8dcc052 Author: Brecht Van Lommel Date: Fri Jul 1 19:11:10 2022 +0200 More tweaks, while working on macOS support: * Rename "libepoxy" to "epoxy", for consistency with other libraries. It was the only one with that lib prefix, while we remove it for others like libpng or libjpeg. * Remove remaining in initContextGLEW for macOS. * Add CONFIGURE_ENV for epoxy build to get proper macOS version flags. * Add meson and ninja to required software to build macOS libs. diff --git a/build_files/build_environment/CMakeLists.txt b/build_files/build_environment/CMakeLists.txt index c06ff4e..a43676c 100644 --- a/build_files/build_environment/CMakeLists.txt +++ b/build_files/build_environment/CMakeLists.txt @@ -52,7 +52,7 @@ include(cmake/imath.cmake) include(cmake/openexr.cmake) include(cmake/brotli.cmake) include(cmake/freetype.cmake) -include(cmake/libepoxy.cmake) +include(cmake/epoxy.cmake) include(cmake/freeglut.cmake) include(cmake/alembic.cmake) include(cmake/opensubdiv.cmake) diff --git a/build_files/build_environment/cmake/download.cmake b/build_files/build_environment/cmake/download.cmake index 191686b..04d6e38 100644 --- a/build_files/build_environment/cmake/download.cmake +++ b/build_files/build_environment/cmake/download.cmake @@ -36,7 +36,7 @@ download_source(BLOSC) download_source(PTHREADS) download_source(OPENEXR) download_source(FREETYPE) -download_source(LIBEPOXY) +download_source(EPOXY) download_source(FREEGLUT) download_source(ALEMBIC) download_source(OPENSUBDIV) diff --git a/build_files/build_environment/cmake/epoxy.cmake b/build_files/build_environment/cmake/epoxy.cmake new file mode 100644 index 0000000..3367f26 --- /dev/null +++ b/build_files/build_environment/cmake/epoxy.cmake @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +ExternalProject_Add(external_epoxy + URL file://${PACKAGE_DIR}/${EPOXY_FILE} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + URL_HASH ${EPOXY_HASH_TYPE}=${EPOXY_HASH} + PREFIX ${BUILD_DIR}/epoxy + CONFIGURE_COMMAND ${CONFIGURE_ENV} && meson setup --prefix ${LIBDIR}/epoxy --default-library static --libdir lib . ../external_epoxy -Dtests=false + BUILD_COMMAND ninja + INSTALL_COMMAND ninja install +) diff --git a/build_files/build_environment/cmake/harvest.cmake b/build_files/build_environment/cmake/harvest.cmake index cae4664..8c5fefc 100644 --- a/build_files/build_environment/cmake/harvest.cmake +++ b/build_files/build_environment/cmake/harvest.cmake @@ -73,8 +73,8 @@ harvest(fftw3/lib fftw3/lib "*.a") harvest(flac/lib sndfile/lib "libFLAC.a") harvest(freetype/include freetype/include "*.h") harvest(freetype/lib/libfreetype2ST.a freetype/lib/libfreetype.a) -harvest(libepoxy/include libepoxy/include "*.h") -harvest(libepoxy/lib libepoxy/lib "*.a") +harvest(epoxy/include epoxy/include "*.h") +harvest(epoxy/lib epoxy/lib "*.a") harvest(gmp/include gmp/include "*.h") harvest(gmp/lib gmp/lib "*.a") harvest(jemalloc/include jemalloc/include "*.h") diff --git a/build_files/build_environment/cmake/libepoxy.cmake b/build_files/build_environment/cmake/libepoxy.cmake deleted file mode 100644 index 29ec911..0000000 --- a/build_files/build_environment/cmake/libepoxy.cmake +++ /dev/null @@ -1,11 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later - -ExternalProject_Add(external_libepoxy - URL file://${PACKAGE_DIR}/${LIBEPOXY_FILE} - DOWNLOAD_DIR ${DOWNLOAD_DIR} - URL_HASH ${LIBEPOXY_HASH_TYPE}=${LIBEPOXY_HASH} - PREFIX ${BUILD_DIR}/libepoxy - CONFIGURE_COMMAND meson setup --prefix ${LIBDIR}/libepoxy --default-library static --libdir lib . ../external_libepoxy -Dtests=false - BUILD_COMMAND ninja - INSTALL_COMMAND ninja install -) diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake index 7851a5a..634ddd7 100644 --- a/build_files/build_environment/cmake/versions.cmake +++ b/build_files/build_environment/cmake/versions.cmake @@ -80,11 +80,11 @@ set(FREETYPE_HASH bd4e3b007474319909a6b79d50908e85) set(FREETYPE_HASH_TYPE MD5) set(FREETYPE_FILE freetype-${FREETYPE_VERSION}.tar.gz) -set(LIBEPOXY_VERSION 1.5.10) -set(LIBEPOXY_URI https://github.com/anholt/libepoxy/archive/refs/tags/${LIBEPOXY_VERSION}.tar.gz) -set(LIBEPOXY_HASH f0730aad115c952e77591fcc805b1dc1) -set(LIBEPOXY_HASH_TYPE MD5) -set(LIBEPOXY_FILE libepoxy-${LIBEPOXY_VERSION}.tar.gz) +set(EPOXY_VERSION 1.5.10) +set(EPOXY_URI https://github.com/anholt/libepoxy/archive/refs/tags/${EPOXY_VERSION}.tar.gz) +set(EPOXY_HASH f0730aad115c952e77591fcc805b1dc1) +set(EPOXY_HASH_TYPE MD5) +set(EPOXY_FILE libepoxy-${EPOXY_VERSION}.tar.gz) set(FREEGLUT_VERSION 3.0.0) set(FREEGLUT_URI http://prdownloads.sourceforge.net/freeglut/freeglut/${FREEGLUT_VERSION}/freeglut-${FREEGLUT_VERSION}.tar.gz) diff --git a/build_files/cmake/Modules/FindEpoxy.cmake b/build_files/cmake/Modules/FindEpoxy.cmake new file mode 100644 index 0000000..7cd26e4 --- /dev/null +++ b/build_files/cmake/Modules/FindEpoxy.cmake @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2022 Blender Foundation. + +# This module defines +# Epoxy_INCLUDE_DIRS, where to find epoxy/gl.h +# Epoxy_LIBRARY, where to find the epoxy library. +# Epoxy_ROOT_DIR, The base directory to search for epoxy. +# This can also be an environment variable. +# Epoxy_FOUND, If false, do not try to use epoxy. + +IF(NOT EPOXY_ROOT_DIR AND NOT $ENV{EPOXY_ROOT_DIR} STREQUAL "") + SET(EPOXY_ROOT_DIR $ENV{EPOXY_ROOT_DIR}) +ENDIF() + +FIND_PATH(Epoxy_INCLUDE_DIR + NAMES + epoxy/gl.h + HINTS + ${EPOXY_ROOT_DIR} + PATH_SUFFIXES + include +) + +FIND_LIBRARY(Epoxy_LIBRARY + NAMES + epoxy + HINTS + ${EPOXY_ROOT_DIR} + PATH_SUFFIXES + lib64 lib +) + +# handle the QUIETLY and REQUIRED arguments and set Epoxy_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Epoxy DEFAULT_MSG + Epoxy_LIBRARY Epoxy_INCLUDE_DIR) + +IF(Epoxy_FOUND) + SET(Epoxy_INCLUDE_DIRS ${Epoxy_INCLUDE_DIR}) + SET(Epoxy_LIBRARIES ${Epoxy_LIBRARY}) +ENDIF() + +MARK_AS_ADVANCED( + Epoxy_INCLUDE_DIR + Epoxy_LIBRARY +) diff --git a/build_files/cmake/Modules/FindLibEpoxy.cmake b/build_files/cmake/Modules/FindLibEpoxy.cmake deleted file mode 100644 index 1da52f9..0000000 --- a/build_files/cmake/Modules/FindLibEpoxy.cmake +++ /dev/null @@ -1,47 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# Copyright 2022 Blender Foundation. - -# This module defines -# LibEpoxy_INCLUDE_DIRS, where to find epoxy/gl.h -# LibEpoxy_LIBRARY, where to find the epoxy library. -# LibEpoxy_ROOT_DIR, The base directory to search for libepoxy. -# This can also be an environment variable. -# LibEpoxy_FOUND, If false, do not try to use libepoxy. - -IF(NOT EPOXY_ROOT_DIR AND NOT $ENV{EPOXY_ROOT_DIR} STREQUAL "") - SET(EPOXY_ROOT_DIR $ENV{EPOXY_ROOT_DIR}) -ENDIF() - -FIND_PATH(LibEpoxy_INCLUDE_DIR - NAMES - epoxy/gl.h - HINTS - ${EPOXY_ROOT_DIR} - PATH_SUFFIXES - include -) - -FIND_LIBRARY(LibEpoxy_LIBRARY - NAMES - epoxy - HINTS - ${EPOXY_ROOT_DIR} - PATH_SUFFIXES - lib64 lib -) - -# handle the QUIETLY and REQUIRED arguments and set LibEpoxy_FOUND to TRUE if -# all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibEpoxy DEFAULT_MSG - LibEpoxy_LIBRARY LibEpoxy_INCLUDE_DIR) - -IF(LibEpoxy_FOUND) - SET(LibEpoxy_INCLUDE_DIRS ${LibEpoxy_INCLUDE_DIR}) - SET(LibEpoxy_LIBRARIES ${LibEpoxy_LIBRARY}) -ENDIF() - -MARK_AS_ADVANCED( - LibEpoxy_INCLUDE_DIR - LibEpoxy_LIBRARY -) diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake index dfe0ed8..487013f 100644 --- a/build_files/cmake/platform/platform_apple.cmake +++ b/build_files/cmake/platform/platform_apple.cmake @@ -223,8 +223,8 @@ if(WITH_SDL) endif() endif() -set(EPOXY_ROOT_DIR ${LIBDIR}/libepoxy) -find_package(LibEpoxy REQUIRED) +set(EPOXY_ROOT_DIR ${LIBDIR}/epoxy) +find_package(Epoxy REQUIRED) set(PNG_ROOT ${LIBDIR}/png) find_package(PNG REQUIRED) diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake index 18b38de..6ab6a87 100644 --- a/build_files/cmake/platform/platform_unix.cmake +++ b/build_files/cmake/platform/platform_unix.cmake @@ -95,7 +95,7 @@ find_package_wrapper(JPEG REQUIRED) find_package_wrapper(PNG REQUIRED) find_package_wrapper(ZLIB REQUIRED) find_package_wrapper(Zstd REQUIRED) -find_package_wrapper(LibEpoxy REQUIRED) +find_package_wrapper(Epoxy REQUIRED) if(NOT WITH_SYSTEM_FREETYPE) # FreeType compiled with Brotli compression for woff2. diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake index 71d60e5..b4c54d9 100644 --- a/build_files/cmake/platform/platform_win32.cmake +++ b/build_files/cmake/platform/platform_win32.cmake @@ -323,8 +323,8 @@ if(NOT JPEG_FOUND) set(JPEG_LIBRARIES ${LIBDIR}/jpeg/lib/libjpeg.lib) endif() -set(EPOXY_ROOT_DIR ${LIBDIR}/libepoxy) -find_package(LibEpoxy REQUIRED) +set(EPOXY_ROOT_DIR ${LIBDIR}/epoxy) +find_package(Epoxy REQUIRED) set(PTHREADS_INCLUDE_DIRS ${LIBDIR}/pthreads/include) set(PTHREADS_LIBRARIES ${LIBDIR}/pthreads/lib/pthreadVC3.lib) diff --git a/intern/cycles/app/CMakeLists.txt b/intern/cycles/app/CMakeLists.txt index fe8325f..d46ece5 100644 --- a/intern/cycles/app/CMakeLists.txt +++ b/intern/cycles/app/CMakeLists.txt @@ -44,8 +44,8 @@ endif() if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI) add_definitions(${GL_DEFINITIONS}) - list(APPEND INC_SYS ${LibEpoxy_INCLUDE_DIRS} ${SDL2_INCLUDE_DIRS}) - list(APPEND LIB ${CYCLES_GL_LIBRARIES} ${LibEpoxy_LIBRARIES} ${SDL2_LIBRARIES}) + list(APPEND INC_SYS ${Epoxy_INCLUDE_DIRS} ${SDL2_INCLUDE_DIRS}) + list(APPEND LIB ${CYCLES_GL_LIBRARIES} ${Epoxy_LIBRARIES} ${SDL2_LIBRARIES}) endif() cycles_external_libraries_append(LIB) diff --git a/intern/cycles/blender/CMakeLists.txt b/intern/cycles/blender/CMakeLists.txt index 1dcbdf8..c6f8fc3 100644 --- a/intern/cycles/blender/CMakeLists.txt +++ b/intern/cycles/blender/CMakeLists.txt @@ -12,7 +12,7 @@ set(INC ) set(INC_SYS - ${LibEpoxy_INCLUDE_DIRS} + ${Epoxy_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ) @@ -63,7 +63,7 @@ set(LIB cycles_subd cycles_util - ${LibEpoxy_LIBRARIES} + ${Epoxy_LIBRARIES} ${PYTHON_LINKFLAGS} ${PYTHON_LIBRARIES} ) diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake index c152f2b..bc859d8 100644 --- a/intern/cycles/cmake/external_libs.cmake +++ b/intern/cycles/cmake/external_libs.cmake @@ -505,17 +505,17 @@ if(CYCLES_STANDALONE_REPOSITORY) endif() ########################################################################### -# Libepoxy +# Epoxy ########################################################################### if(CYCLES_STANDALONE_REPOSITORY) if((WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI) OR WITH_CYCLES_HYDRA_RENDER_DELEGATE) if(MSVC AND EXISTS ${_cycles_lib_dir}) - set(LibEpoxy_LIBRARIES "${_cycles_lib_dir}/libepoxy/lib/epoxy.lib") - set(LibEpoxy_INCLUDE_DIRS "${_cycles_lib_dir}/libepoxy/include") + set(Epoxy_LIBRARIES "${_cycles_lib_dir}/epoxy/lib/epoxy.lib") + set(Epoxy_INCLUDE_DIRS "${_cycles_lib_dir}/epoxy/include") else() - find_package(LibEpoxy REQUIRED) + find_package(Epoxy REQUIRED) endif() endif() endif() diff --git a/intern/cycles/hydra/CMakeLists.txt b/intern/cycles/hydra/CMakeLists.txt index 67a4585..60bb40a 100644 --- a/intern/cycles/hydra/CMakeLists.txt +++ b/intern/cycles/hydra/CMakeLists.txt @@ -10,14 +10,14 @@ set(INC ) set(INC_SYS ${USD_INCLUDE_DIRS} - ${LibEpoxy_INCLUDE_DIRS} + ${Epoxy_INCLUDE_DIRS} ) set(LIB cycles_scene cycles_session cycles_graph - ${LibEpoxy_LIBRARIES} + ${Epoxy_LIBRARIES} ) cycles_external_libraries_append(LIB) diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt index da7b4ff..86cd2d4 100644 --- a/intern/ghost/CMakeLists.txt +++ b/intern/ghost/CMakeLists.txt @@ -8,7 +8,7 @@ set(INC ) set(INC_SYS - ${LibEpoxy_INCLUDE_DIRS} + ${Epoxy_INCLUDE_DIRS} ) set(SRC @@ -67,7 +67,7 @@ set(SRC ) set(LIB - ${LibEpoxy_LIBRARIES} + ${Epoxy_LIBRARIES} ) if(WITH_GHOST_DEBUG) diff --git a/intern/ghost/intern/GHOST_ContextCGL.mm b/intern/ghost/intern/GHOST_ContextCGL.mm index dd800ef..19df38a 100644 --- a/intern/ghost/intern/GHOST_ContextCGL.mm +++ b/intern/ghost/intern/GHOST_ContextCGL.mm @@ -274,8 +274,6 @@ GHOST_TSuccess GHOST_ContextCGL::initializeDrawingContext() } #endif - initContextGLEW(); - if (m_metalView) { if (m_defaultFramebuffer == 0) { /* Create a virtual frame-buffer. */ diff --git a/intern/opencolorio/CMakeLists.txt b/intern/opencolorio/CMakeLists.txt index 187fcd5..d676079 100644 --- a/intern/opencolorio/CMakeLists.txt +++ b/intern/opencolorio/CMakeLists.txt @@ -36,7 +36,7 @@ if(WITH_OPENCOLORIO) list(APPEND INC_SYS ${OPENCOLORIO_INCLUDE_DIRS} - ${LibEpoxy_INCLUDE_DIRS} + ${Epoxy_INCLUDE_DIRS} ) list(APPEND SRC diff --git a/intern/opensubdiv/CMakeLists.txt b/intern/opensubdiv/CMakeLists.txt index f828724..5ae97e1 100644 --- a/intern/opensubdiv/CMakeLists.txt +++ b/intern/opensubdiv/CMakeLists.txt @@ -29,7 +29,7 @@ if(WITH_OPENSUBDIV) list(APPEND INC_SYS ${OPENSUBDIV_INCLUDE_DIRS} - ${LibEpoxy_INCLUDE_DIRS} + ${Epoxy_INCLUDE_DIRS} ) list(APPEND SRC diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt index 389dc29..e6ba1d6 100644 --- a/source/blender/gpu/CMakeLists.txt +++ b/source/blender/gpu/CMakeLists.txt @@ -36,7 +36,7 @@ set(INC ) set(INC_SYS - ${LibEpoxy_INCLUDE_DIRS} + ${Epoxy_INCLUDE_DIRS} ) set(SRC @@ -213,7 +213,7 @@ endif() set(LIB ${BLENDER_GL_LIBRARIES} - ${LibEpoxy_LIBRARIES} + ${Epoxy_LIBRARIES} ) set(MSL_SRC diff --git a/source/blender/python/generic/CMakeLists.txt b/source/blender/python/generic/CMakeLists.txt index dee10d5..713f2c5 100644 --- a/source/blender/python/generic/CMakeLists.txt +++ b/source/blender/python/generic/CMakeLists.txt @@ -11,7 +11,7 @@ set(INC ) set(INC_SYS - ${LibEpoxy_INCLUDE_DIRS} + ${Epoxy_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ) @@ -40,7 +40,7 @@ set(SRC ) set(LIB - ${LibEpoxy_LIBRARIES} + ${Epoxy_LIBRARIES} ${PYTHON_LINKFLAGS} ${PYTHON_LIBRARIES} ) diff --git a/source/blender/python/gpu/CMakeLists.txt b/source/blender/python/gpu/CMakeLists.txt index 68a72638a..119aba2 100644 --- a/source/blender/python/gpu/CMakeLists.txt +++ b/source/blender/python/gpu/CMakeLists.txt @@ -12,7 +12,7 @@ set(INC ) set(INC_SYS - ${LibEpoxy_INCLUDE_DIRS} + ${Epoxy_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ) @@ -58,7 +58,7 @@ set(SRC ) set(LIB - ${LibEpoxy_LIBRARIES} + ${Epoxy_LIBRARIES} ${PYTHON_LINKFLAGS} ${PYTHON_LIBRARIES} )