From 8ffc11dbcb21e81634e8f22cd65fdc921c7320d1 Mon Sep 17 00:00:00 2001 From: Sebastian Parborg Date: Mon, 15 Aug 2022 16:44:24 +0200 Subject: Cleanup OpenGL linking and related code after libepoxy merge This cleans up the OpenGL build flags and linking. It additionally also removes some dead code. One of these dead code paths is WITH_X11_ALPHA which actually never was active even with the build flag on. The call to use this was never called because the default initializer for GHOST was set to have it off per default. Nothing called this function with a boolean value to enable it. These cleanups are needed to support true headless OpenGL rendering. Without these cleanups libepoxy will fail to load the correct OpenGL Libraries as we have already linked them to the blender binary. Reviewed By: Brecht, Campbell, Jeroen Differential Revision: http://developer.blender.org/D15554 --- intern/cycles/app/CMakeLists.txt | 3 +-- intern/cycles/blender/CMakeLists.txt | 2 -- intern/cycles/cmake/external_libs.cmake | 19 ------------------- intern/cycles/device/CMakeLists.txt | 3 --- intern/cycles/hydra/CMakeLists.txt | 2 -- intern/cycles/scene/CMakeLists.txt | 2 -- intern/cycles/session/CMakeLists.txt | 2 -- intern/cycles/util/CMakeLists.txt | 2 -- 8 files changed, 1 insertion(+), 34 deletions(-) (limited to 'intern/cycles') diff --git a/intern/cycles/app/CMakeLists.txt b/intern/cycles/app/CMakeLists.txt index d46ece55256..0988b1c0ac4 100644 --- a/intern/cycles/app/CMakeLists.txt +++ b/intern/cycles/app/CMakeLists.txt @@ -43,9 +43,8 @@ else() endif() if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI) - add_definitions(${GL_DEFINITIONS}) list(APPEND INC_SYS ${Epoxy_INCLUDE_DIRS} ${SDL2_INCLUDE_DIRS}) - list(APPEND LIB ${CYCLES_GL_LIBRARIES} ${Epoxy_LIBRARIES} ${SDL2_LIBRARIES}) + list(APPEND LIB ${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 095615f15d5..ab0937ac9eb 100644 --- a/intern/cycles/blender/CMakeLists.txt +++ b/intern/cycles/blender/CMakeLists.txt @@ -87,8 +87,6 @@ set(ADDON_FILES addon/version_update.py ) -add_definitions(${GL_DEFINITIONS}) - if(WITH_CYCLES_DEVICE_HIP) add_definitions(-DWITH_HIP) endif() diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake index bc859d830ba..af2f280ae84 100644 --- a/intern/cycles/cmake/external_libs.cmake +++ b/intern/cycles/cmake/external_libs.cmake @@ -549,25 +549,6 @@ if(EXISTS ${_cycles_lib_dir}) unset(_cycles_lib_dir) endif() -########################################################################### -# OpenGL -########################################################################### - -if((WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI) OR - WITH_CYCLES_HYDRA_RENDER_DELEGATE) - if(CYCLES_STANDALONE_REPOSITORY) - if(NOT DEFINED OpenGL_GL_PREFERENCE) - set(OpenGL_GL_PREFERENCE "LEGACY") - endif() - - find_package(OpenGL REQUIRED) - - set(CYCLES_GL_LIBRARIES ${OPENGL_gl_LIBRARY}) - else() - set(CYCLES_GL_LIBRARIES ${BLENDER_GL_LIBRARIES}) - endif() -endif() - ########################################################################### # SDL ########################################################################### diff --git a/intern/cycles/device/CMakeLists.txt b/intern/cycles/device/CMakeLists.txt index 71789a76406..4ae123cd634 100644 --- a/intern/cycles/device/CMakeLists.txt +++ b/intern/cycles/device/CMakeLists.txt @@ -147,7 +147,6 @@ set(SRC set(LIB cycles_kernel cycles_util - ${CYCLES_GL_LIBRARIES} ) if(WITH_CYCLES_DEVICE_OPTIX OR WITH_CYCLES_DEVICE_CUDA) @@ -168,8 +167,6 @@ if(WITH_CYCLES_DEVICE_HIP AND WITH_HIP_DYNLOAD) ) endif() -add_definitions(${GL_DEFINITIONS}) - if(WITH_CYCLES_DEVICE_CUDA) add_definitions(-DWITH_CUDA) endif() diff --git a/intern/cycles/hydra/CMakeLists.txt b/intern/cycles/hydra/CMakeLists.txt index 60bb40a0d63..2bbd46db582 100644 --- a/intern/cycles/hydra/CMakeLists.txt +++ b/intern/cycles/hydra/CMakeLists.txt @@ -64,8 +64,6 @@ set(SRC_HD_CYCLES volume.cpp ) -add_definitions(${GL_DEFINITIONS}) - if(WITH_OPENVDB) add_definitions(-DWITH_OPENVDB ${OPENVDB_DEFINITIONS}) list(APPEND INC_SYS diff --git a/intern/cycles/scene/CMakeLists.txt b/intern/cycles/scene/CMakeLists.txt index 4904bf247ba..a30f408f207 100644 --- a/intern/cycles/scene/CMakeLists.txt +++ b/intern/cycles/scene/CMakeLists.txt @@ -148,6 +148,4 @@ endif() include_directories(${INC}) include_directories(SYSTEM ${INC_SYS}) -add_definitions(${GL_DEFINITIONS}) - cycles_add_library(cycles_scene "${LIB}" ${SRC} ${SRC_HEADERS}) diff --git a/intern/cycles/session/CMakeLists.txt b/intern/cycles/session/CMakeLists.txt index 6e4e6af6e71..4f3a0a99ee1 100644 --- a/intern/cycles/session/CMakeLists.txt +++ b/intern/cycles/session/CMakeLists.txt @@ -32,6 +32,4 @@ set(LIB include_directories(${INC}) include_directories(SYSTEM ${INC_SYS}) -add_definitions(${GL_DEFINITIONS}) - cycles_add_library(cycles_session "${LIB}" ${SRC} ${SRC_HEADERS}) diff --git a/intern/cycles/util/CMakeLists.txt b/intern/cycles/util/CMakeLists.txt index 2dafe729dfe..997d574a3b0 100644 --- a/intern/cycles/util/CMakeLists.txt +++ b/intern/cycles/util/CMakeLists.txt @@ -148,6 +148,4 @@ endif() include_directories(${INC}) include_directories(SYSTEM ${INC_SYS}) -add_definitions(${GL_DEFINITIONS}) - cycles_add_library(cycles_util "${LIB}" ${SRC} ${SRC_HEADERS}) -- cgit v1.2.3