[Bf-blender-cvs] [1f31269f30e] epoxy: move epoxy discovery to platform scripts

Brecht Van Lommel noreply at git.blender.org
Fri Jul 1 11:22:03 CEST 2022


Commit: 1f31269f30eddafe9917328480fcd7a100b01f17
Author: Brecht Van Lommel
Date:   Wed Jun 29 18:31:07 2022 +0100
Branches: epoxy
https://developer.blender.org/rB1f31269f30eddafe9917328480fcd7a100b01f17

move epoxy discovery to platform scripts

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

M	CMakeLists.txt
M	build_files/cmake/platform/platform_apple.cmake
M	build_files/cmake/platform/platform_unix.cmake
M	build_files/cmake/platform/platform_win32.cmake
M	intern/cycles/app/CMakeLists.txt
M	intern/cycles/blender/CMakeLists.txt
M	intern/cycles/cmake/external_libs.cmake
M	intern/cycles/device/hip/device_impl.cpp
M	intern/cycles/hydra/CMakeLists.txt
M	intern/ghost/CMakeLists.txt
M	intern/opencolorio/CMakeLists.txt
M	intern/opensubdiv/CMakeLists.txt
M	source/blender/gpu/CMakeLists.txt
M	source/blender/python/generic/CMakeLists.txt
M	source/blender/python/gpu/CMakeLists.txt

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

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ac524619809..0619cc11211 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1320,12 +1320,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)
diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake
index 32b10625590..dfe0ed8527d 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 dff860d9876..18b38de3deb 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -95,6 +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)
 
 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 7e272ea26b0..71d60e56213 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)
+find_package(LibEpoxy 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 4c9eb9a143c..fe8325f636e 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 a53b2528582..1dcbdf8f457 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 497c9a5407c..c152f2b5e4c 100644
--- a/intern/cycles/cmake/external_libs.cmake
+++ b/intern/cycles/cmake/external_libs.cmake
@@ -504,6 +504,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 82db55ea715..a84f1edd70e 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 e7c2e0dafa9..67a4585b507 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 6ee5dece064..da7b4ffe589 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 a725a32b39a..187fcd5d539 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 7d15936d0a0..f828724a8c8 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/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt
index 6dcf93b5fa3..389dc292633 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 a53228eda6e..dee10d57ffd 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 941b1bcc935..68a72638ac1 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}
 )



More information about the Bf-blender-cvs mailing list