commit b47980f Author: Brecht Van Lommel Date: Wed Jun 29 14:48:15 2022 +0200 * Move find package to various platform files * Set include dirs and libraries per module, not globally * Add libepoxy detection for Cycles standalone repo * Remove unnecessary undef OSD_USES_GLEW, already remove from CMakeLists.txt * Revert unintended changes to API docs diff --git a/CMakeLists.txt b/CMakeLists.txt index 798449e..e984bf6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1305,13 +1305,6 @@ else() list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_CORE) endif() -# link libepoxy -set(EPOXY_ROOT_DIR ${LIBDIR}/libepoxy) -find_package(LibEpoxy REQUIRED) -list(APPEND BLENDER_GL_LIBRARIES ${LibEpoxy_LIBRARIES}) -include_directories(${LibEpoxy_INCLUDE_DIRS}) - -#----------------------------------------------------------------------------- # Configure Metal. if (WITH_METAL_BACKEND) add_definitions(-DWITH_METAL_BACKEND) diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake index 32b1062..dfe0ed8 100644 --- a/build_files/cmake/platform/platform_apple.cmake +++ b/build_files/cmake/platform/platform_apple.cmake @@ -223,6 +223,9 @@ if(WITH_SDL) endif() endif() +set(EPOXY_ROOT_DIR ${LIBDIR}/libepoxy) +find_package(LibEpoxy 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 2d003f2..95aed26 100644 --- a/build_files/cmake/platform/platform_unix.cmake +++ b/build_files/cmake/platform/platform_unix.cmake @@ -89,6 +89,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) 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 40c25ab..257d37f 100644 --- a/build_files/cmake/platform/platform_win32.cmake +++ b/build_files/cmake/platform/platform_win32.cmake @@ -323,6 +323,9 @@ if(NOT JPEG_FOUND) set(JPEG_LIBRARIES ${LIBDIR}/jpeg/lib/libjpeg.lib) endif() +set(EPOXY_ROOT_DIR ${LIBDIR}/libepoxy) +windows_find_package(LibEpoxy REQUIRED) + set(PTHREADS_INCLUDE_DIRS ${LIBDIR}/pthreads/include) set(PTHREADS_LIBRARIES ${LIBDIR}/pthreads/lib/pthreadVC3.lib) diff --git a/doc/python_api/sphinx_changelog_gen.py b/doc/python_api/sphinx_changelog_gen.py index 0a1b42b..b8c8919 100644 --- a/doc/python_api/sphinx_changelog_gen.py +++ b/doc/python_api/sphinx_changelog_gen.py @@ -423,8 +423,7 @@ def main(argv=None): help="Path of the JSON file containing the dump of the API.") parser_dump.set_defaults(func=api_dump) - parser_changelog = parser_commands.add_parser( - 'changelog', help="Generate the RST changelog page based on two Blender Python API JSON dumps.") + parser_changelog = parser_commands.add_parser('changelog', help="Generate the RST changelog page based on two Blender Python API JSON dumps.") parser_changelog.add_argument( "--filepath-in-from", dest="filepath_in_from", metavar='FILE', default=None, diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index 0c2788a..4f27b66 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -549,21 +549,9 @@ def generate_changelog(): API_DUMP_FILEPATH = os.path.abspath(os.path.join(API_DUMP_ROOT, BLENDER_VERSION_DOTS, "api_dump.json")) API_CHANGELOG_FILEPATH = os.path.abspath(os.path.join(SPHINX_IN_TMP, "change_log.rst")) - sphinx_changelog_gen.main( - ("--", - "--indexpath", - API_DUMP_INDEX_FILEPATH, - "dump", - "--filepath-out", - API_DUMP_FILEPATH)) - - sphinx_changelog_gen.main( - ("--", - "--indexpath", - API_DUMP_INDEX_FILEPATH, - "changelog", - "--filepath-out", - API_CHANGELOG_FILEPATH)) + sphinx_changelog_gen.main(("--", "--indexpath", API_DUMP_INDEX_FILEPATH, "dump", "--filepath-out", API_DUMP_FILEPATH)) + + sphinx_changelog_gen.main(("--", "--indexpath", API_DUMP_INDEX_FILEPATH, "changelog", "--filepath-out", API_CHANGELOG_FILEPATH)) # --------------------------------API DUMP-------------------------------------- diff --git a/intern/cycles/app/CMakeLists.txt b/intern/cycles/app/CMakeLists.txt index 4c9eb9a..fe8325f 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 ${SDL2_INCLUDE_DIRS}) - list(APPEND LIB ${CYCLES_GL_LIBRARIES} ${SDL2_LIBRARIES}) + list(APPEND INC_SYS ${LibEpoxy_INCLUDE_DIRS} ${SDL2_INCLUDE_DIRS}) + list(APPEND LIB ${CYCLES_GL_LIBRARIES} ${LibEpoxy_LIBRARIES} ${SDL2_LIBRARIES}) endif() cycles_external_libraries_append(LIB) diff --git a/intern/cycles/blender/CMakeLists.txt b/intern/cycles/blender/CMakeLists.txt index a53b252..1dcbdf8 100644 --- a/intern/cycles/blender/CMakeLists.txt +++ b/intern/cycles/blender/CMakeLists.txt @@ -12,6 +12,7 @@ set(INC ) set(INC_SYS + ${LibEpoxy_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ) @@ -62,6 +63,7 @@ set(LIB cycles_subd cycles_util + ${LibEpoxy_LIBRARIES} ${PYTHON_LINKFLAGS} ${PYTHON_LIBRARIES} ) diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake index 3411dd5..e62d76b 100644 --- a/intern/cycles/cmake/external_libs.cmake +++ b/intern/cycles/cmake/external_libs.cmake @@ -502,6 +502,22 @@ if(CYCLES_STANDALONE_REPOSITORY) endif() endif() +########################################################################### +# Libepoxy +########################################################################### + +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") + else() + find_package(LibEpoxy REQUIRED) + endif() + endif() +endif() + ########################################################################### # Alembic ########################################################################### diff --git a/intern/cycles/device/hip/device_impl.cpp b/intern/cycles/device/hip/device_impl.cpp index 82db55e..a84f1ed 100644 --- a/intern/cycles/device/hip/device_impl.cpp +++ b/intern/cycles/device/hip/device_impl.cpp @@ -16,7 +16,6 @@ # include "util/log.h" # include "util/map.h" # include "util/md5.h" -# include "util/opengl.h" # include "util/path.h" # include "util/string.h" # include "util/system.h" diff --git a/intern/cycles/hydra/CMakeLists.txt b/intern/cycles/hydra/CMakeLists.txt index e7c2e0d..67a4585 100644 --- a/intern/cycles/hydra/CMakeLists.txt +++ b/intern/cycles/hydra/CMakeLists.txt @@ -10,12 +10,14 @@ set(INC ) set(INC_SYS ${USD_INCLUDE_DIRS} + ${LibEpoxy_INCLUDE_DIRS} ) set(LIB cycles_scene cycles_session cycles_graph + ${LibEpoxy_LIBRARIES} ) cycles_external_libraries_append(LIB) diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt index 6ee5dec..da7b4ff 100644 --- a/intern/ghost/CMakeLists.txt +++ b/intern/ghost/CMakeLists.txt @@ -7,7 +7,9 @@ set(INC ../../source/blender/makesdna ) -set(INC_SYS ) +set(INC_SYS + ${LibEpoxy_INCLUDE_DIRS} +) set(SRC intern/GHOST_Buttons.cpp @@ -64,7 +66,9 @@ set(SRC intern/GHOST_WindowManager.h ) -set(LIB ) +set(LIB + ${LibEpoxy_LIBRARIES} +) if(WITH_GHOST_DEBUG) list(APPEND SRC diff --git a/intern/opencolorio/CMakeLists.txt b/intern/opencolorio/CMakeLists.txt index a725a32..187fcd5 100644 --- a/intern/opencolorio/CMakeLists.txt +++ b/intern/opencolorio/CMakeLists.txt @@ -36,6 +36,7 @@ if(WITH_OPENCOLORIO) list(APPEND INC_SYS ${OPENCOLORIO_INCLUDE_DIRS} + ${LibEpoxy_INCLUDE_DIRS} ) list(APPEND SRC diff --git a/intern/opensubdiv/CMakeLists.txt b/intern/opensubdiv/CMakeLists.txt index 7d15936..f828724 100644 --- a/intern/opensubdiv/CMakeLists.txt +++ b/intern/opensubdiv/CMakeLists.txt @@ -29,6 +29,7 @@ if(WITH_OPENSUBDIV) list(APPEND INC_SYS ${OPENSUBDIV_INCLUDE_DIRS} + ${LibEpoxy_INCLUDE_DIRS} ) list(APPEND SRC diff --git a/intern/opensubdiv/internal/evaluator/eval_output.h b/intern/opensubdiv/internal/evaluator/eval_output.h index 286ffaa..e8480e8 100644 --- a/intern/opensubdiv/internal/evaluator/eval_output.h +++ b/intern/opensubdiv/internal/evaluator/eval_output.h @@ -19,8 +19,6 @@ #ifndef OPENSUBDIV_EVAL_OUTPUT_H_ #define OPENSUBDIV_EVAL_OUTPUT_H_ -#undef OSD_USES_GLEW - #include #include #include diff --git a/intern/opensubdiv/internal/evaluator/gl_compute_evaluator.h b/intern/opensubdiv/internal/evaluator/gl_compute_evaluator.h index 07d13aa..85c12f7 100644 --- a/intern/opensubdiv/internal/evaluator/gl_compute_evaluator.h +++ b/intern/opensubdiv/internal/evaluator/gl_compute_evaluator.h @@ -25,8 +25,6 @@ #ifndef OPENSUBDIV_GL_COMPUTE_EVALUATOR_H_ #define OPENSUBDIV_GL_COMPUTE_EVALUATOR_H_ -#undef OSD_USES_GLEW - #include #include #include diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt index 6dcf93b..389dc29 100644 --- a/source/blender/gpu/CMakeLists.txt +++ b/source/blender/gpu/CMakeLists.txt @@ -35,7 +35,9 @@ set(INC ../../../intern/mantaflow/extern ) -set(INC_SYS ) +set(INC_SYS + ${LibEpoxy_INCLUDE_DIRS} +) set(SRC intern/gpu_batch.cc @@ -211,6 +213,7 @@ endif() set(LIB ${BLENDER_GL_LIBRARIES} + ${LibEpoxy_LIBRARIES} ) set(MSL_SRC diff --git a/source/blender/python/generic/CMakeLists.txt b/source/blender/python/generic/CMakeLists.txt index a53228e..dee10d5 100644 --- a/source/blender/python/generic/CMakeLists.txt +++ b/source/blender/python/generic/CMakeLists.txt @@ -11,6 +11,7 @@ set(INC ) set(INC_SYS + ${LibEpoxy_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ) @@ -39,6 +40,7 @@ set(SRC ) set(LIB + ${LibEpoxy_LIBRARIES} ${PYTHON_LINKFLAGS} ${PYTHON_LIBRARIES} ) diff --git a/source/blender/python/gpu/CMakeLists.txt b/source/blender/python/gpu/CMakeLists.txt index 941b1bc..68a72638a 100644 --- a/source/blender/python/gpu/CMakeLists.txt +++ b/source/blender/python/gpu/CMakeLists.txt @@ -12,6 +12,7 @@ set(INC ) set(INC_SYS + ${LibEpoxy_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ) @@ -57,6 +58,7 @@ set(SRC ) set(LIB + ${LibEpoxy_LIBRARIES} ${PYTHON_LINKFLAGS} ${PYTHON_LIBRARIES} )