This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/python/generic/CMakeLists.txt
Campbell Barton 00dc747702 Fix T99706: Crash rendering with headless builds
When rendering with headless builds, show an error instead of crashing.

Previously GPU_backend_init was called indirectly from
DRW_opengl_context_create, a new function is now called from the window
manager (GPU_backend_init_once), so it's possible to check if the GPU
has a back-end.

This also disables the `bgl` Python module when building WITH_HEADLESS.

Reviewed By: fclem

Ref D15463
2022-07-15 22:16:44 +10:00

58 lines
831 B
CMake

# SPDX-License-Identifier: GPL-2.0-or-later
set(INC
.
../../blenkernel
../../blenlib
../../gpu
../../makesdna
../../makesrna
../../../../intern/glew-mx
../../../../intern/guardedalloc
)
set(INC_SYS
${GLEW_INCLUDE_PATH}
${PYTHON_INCLUDE_DIRS}
)
set(SRC
bl_math_py_api.c
blf_py_api.c
bpy_threads.c
idprop_py_api.c
idprop_py_ui_api.c
imbuf_py_api.c
py_capi_rna.c
py_capi_utils.c
bl_math_py_api.h
blf_py_api.h
idprop_py_api.h
idprop_py_ui_api.h
imbuf_py_api.h
py_capi_rna.h
py_capi_utils.h
# header-only
python_utildefines.h
)
if(WITH_OPENGL)
list(APPEND SRC
bgl.c
bgl.h
)
endif()
set(LIB
${GLEW_LIBRARY}
${PYTHON_LINKFLAGS}
${PYTHON_LIBRARIES}
)
add_definitions(${GL_DEFINITIONS})
blender_add_lib(bf_python_ext "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")