Adding "build_options" to bpy.app, a frozenset containing strings matching optional feature's build defines (like 'FFMPEG', 'MOD_BOOLEAN', 'INTERNATIONAL', etc.) for all enabled elements.
Note I tried to select all interesting defines, but this might be extended if needed...
This commit is contained in:
@@ -47,6 +47,7 @@ set(SRC
|
||||
bpy.c
|
||||
bpy_app.c
|
||||
bpy_app_ffmpeg.c
|
||||
bpy_app_build_options.c
|
||||
bpy_app_handlers.c
|
||||
bpy_driver.c
|
||||
bpy_interface.c
|
||||
@@ -68,6 +69,7 @@ set(SRC
|
||||
bpy.h
|
||||
bpy_app.h
|
||||
bpy_app_ffmpeg.h
|
||||
bpy_app_build_options.h
|
||||
bpy_app_handlers.h
|
||||
bpy_driver.h
|
||||
bpy_intern_string.h
|
||||
@@ -96,24 +98,136 @@ if(WITH_PYTHON_SAFETY)
|
||||
add_definitions(-DWITH_PYTHON_SAFETY)
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
if(WITH_AUDASPACE)
|
||||
add_definitions(-DWITH_AUDASPACE)
|
||||
endif()
|
||||
|
||||
if(WITH_CYCLES)
|
||||
add_definitions(-DWITH_CYCLES)
|
||||
if(WITH_BULLET)
|
||||
add_definitions(-DWITH_BULLET)
|
||||
endif()
|
||||
|
||||
if(WITH_INTERNATIONAL)
|
||||
add_definitions(-DWITH_INTERNATIONAL)
|
||||
if(WITH_CODEC_AVI)
|
||||
add_definitions(-DWITH_AVI)
|
||||
endif()
|
||||
|
||||
if(WITH_CODEC_FFMPEG)
|
||||
list(APPEND INC_SYS
|
||||
${FFMPEG_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
add_definitions(-DWITH_FFMPEG)
|
||||
endif()
|
||||
|
||||
if(WITH_CODEC_QUICKTIME)
|
||||
add_definitions(-DWITH_QUICKTIME)
|
||||
endif()
|
||||
|
||||
if(WITH_CODEC_SNDFILE)
|
||||
add_definitions(-DWITH_SNDFILE)
|
||||
endif()
|
||||
|
||||
if(WITH_COMPOSITOR)
|
||||
add_definitions(-DWITH_COMPOSITOR)
|
||||
endif()
|
||||
|
||||
if(WITH_CYCLES)
|
||||
add_definitions(-DWITH_CYCLES)
|
||||
endif()
|
||||
|
||||
if(WITH_CYCLES_OSL)
|
||||
add_definitions(-DWITH_CYCLES_OSL)
|
||||
endif()
|
||||
|
||||
if(WITH_GAMEENGINE)
|
||||
add_definitions(-DWITH_GAMEENGINE)
|
||||
endif()
|
||||
|
||||
if(WITH_IMAGE_CINEON)
|
||||
add_definitions(-DWITH_CINEON)
|
||||
endif()
|
||||
|
||||
if(WITH_IMAGE_DDS)
|
||||
add_definitions(-DWITH_DDS)
|
||||
endif()
|
||||
|
||||
if(WITH_IMAGE_FRAMESERVER)
|
||||
add_definitions(-DWITH_FRAMESERVER)
|
||||
endif()
|
||||
|
||||
if(WITH_IMAGE_HDR)
|
||||
add_definitions(-DWITH_HDR)
|
||||
endif()
|
||||
|
||||
if(WITH_IMAGE_OPENEXR)
|
||||
add_definitions(-DWITH_OPENEXR)
|
||||
endif()
|
||||
|
||||
if(WITH_IMAGE_OPENJPEG)
|
||||
add_definitions(-DWITH_OPENJPEG)
|
||||
endif()
|
||||
|
||||
if(WITH_IMAGE_REDCODE)
|
||||
add_definitions(-DWITH_REDCODE)
|
||||
endif()
|
||||
|
||||
if(WITH_IMAGE_TIFF)
|
||||
add_definitions(-DWITH_TIFF)
|
||||
endif()
|
||||
|
||||
if(WITH_INPUT_NDOF)
|
||||
add_definitions(-DWITH_INPUT_NDOF)
|
||||
endif()
|
||||
|
||||
if(WITH_INTERNATIONAL)
|
||||
add_definitions(-DWITH_INTERNATIONAL)
|
||||
endif()
|
||||
|
||||
if(WITH_JACK)
|
||||
add_definitions(-DWITH_JACK)
|
||||
endif()
|
||||
|
||||
if(WITH_LIBMV)
|
||||
add_definitions(-DWITH_LIBMV)
|
||||
endif()
|
||||
|
||||
if(WITH_LIBMV)
|
||||
add_definitions(-DWITH_LIBMV)
|
||||
endif()
|
||||
|
||||
if(WITH_MOD_BOOLEAN)
|
||||
add_definitions(-DWITH_MOD_BOOLEAN)
|
||||
endif()
|
||||
|
||||
if(WITH_MOD_FLUID)
|
||||
add_definitions(-DWITH_MOD_FLUID)
|
||||
endif()
|
||||
|
||||
if(WITH_MOD_OCEANSIM)
|
||||
add_definitions(-DWITH_OCEANSIM)
|
||||
endif()
|
||||
|
||||
if(WITH_MOD_REMESH)
|
||||
add_definitions(-DWITH_MOD_REMESH)
|
||||
endif()
|
||||
|
||||
if(WITH_MOD_SMOKE)
|
||||
add_definitions(-DWITH_SMOKE)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENAL)
|
||||
add_definitions(-DWITH_OPENAL)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLLADA)
|
||||
add_definitions(-DWITH_COLLADA)
|
||||
endif()
|
||||
|
||||
if(WITH_PLAYER)
|
||||
add_definitions(-DWITH_PLAYER)
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
|
||||
blender_add_lib(bf_python "${SRC}" "${INC}" "${INC_SYS}")
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "bpy_app.h"
|
||||
|
||||
#include "bpy_app_ffmpeg.h"
|
||||
#include "bpy_app_build_options.h"
|
||||
|
||||
#include "bpy_app_handlers.h"
|
||||
#include "bpy_driver.h"
|
||||
@@ -83,6 +84,7 @@ static PyStructSequence_Field app_info_fields[] = {
|
||||
|
||||
/* submodules */
|
||||
{(char *)"ffmpeg", (char *)"FFmpeg library information backend"},
|
||||
{(char *)"build_options", (char *)"A set containing most important enabled optional build features"},
|
||||
{(char *)"handlers", (char *)"Application handler callbacks"},
|
||||
{NULL}
|
||||
};
|
||||
@@ -148,6 +150,7 @@ static PyObject *make_app_info(void)
|
||||
#endif
|
||||
|
||||
SetObjItem(BPY_app_ffmpeg_struct());
|
||||
SetObjItem(BPY_app_build_options_struct());
|
||||
SetObjItem(BPY_app_handlers_struct());
|
||||
|
||||
#undef SetIntItem
|
||||
|
||||
176
source/blender/python/intern/bpy_app_build_options.c
Normal file
176
source/blender/python/intern/bpy_app_build_options.c
Normal file
@@ -0,0 +1,176 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor(s): Bastien Montagne
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file blender/python/intern/bpy_app_build_options.c
|
||||
* \ingroup pythonintern
|
||||
*/
|
||||
|
||||
#include <Python.h>
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "bpy_app_build_options.h"
|
||||
|
||||
static PyObject *make_build_options(void)
|
||||
{
|
||||
PyObject *build_options = PyFrozenSet_New(NULL);
|
||||
|
||||
#define SetStrItem(str) \
|
||||
PySet_Add(build_options, PyUnicode_FromString(str));
|
||||
|
||||
#ifdef WITH_AUDASPACE
|
||||
SetStrItem("AUDASPACE");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_BULLET
|
||||
SetStrItem("BULLET");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_AVI
|
||||
SetStrItem("CODEC_AVI");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_FFMPEG
|
||||
SetStrItem("CODEC_FFMPEG");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_QUICKTIME
|
||||
SetStrItem("CODEC_QUICKTIME");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_SNDFILE
|
||||
SetStrItem("CODEC_SNDFILE");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_COMPOSITOR
|
||||
SetStrItem("COMPOSITOR");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_CYCLES
|
||||
SetStrItem("CYCLES");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_CYCLES_OSL
|
||||
SetStrItem("CYCLES_OSL");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_GAMEENGINE
|
||||
SetStrItem("GAMEENGINE");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_CINEON
|
||||
SetStrItem("IMAGE_CINEON");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_DDS
|
||||
SetStrItem("IMAGE_DDS");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_FRAMESERVER
|
||||
SetStrItem("IMAGE_FRAMESERVER");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_HDR
|
||||
SetStrItem("IMAGE_HDR");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_OPENEXR
|
||||
SetStrItem("IMAGE_OPENEXR");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_OPENJPEG
|
||||
SetStrItem("IMAGE_OPENJPEG");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_REDCODE
|
||||
SetStrItem("IMAGE_REDCODE");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_TIFF
|
||||
SetStrItem("IMAGE_TIFF");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_INPUT_NDOF
|
||||
SetStrItem("INPUT_NDOF");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_INTERNATIONAL
|
||||
SetStrItem("INTERNATIONAL");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_JACK
|
||||
SetStrItem("JACK");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_LIBMV
|
||||
SetStrItem("LIBMV");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_MOD_BOOLEAN
|
||||
SetStrItem("MOD_BOOLEAN");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_MOD_FLUID
|
||||
SetStrItem("MOD_FLUID");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_OCEANSIM
|
||||
SetStrItem("MOD_OCEANSIM");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_MOD_REMESH
|
||||
SetStrItem("MOD_REMESH");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_SMOKE
|
||||
SetStrItem("MOD_SMOKE");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_OPENAL
|
||||
SetStrItem("OPENAL");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_COLLADA
|
||||
SetStrItem("COLLADA");
|
||||
#endif
|
||||
|
||||
#ifdef WITH_PLAYER
|
||||
SetStrItem("PLAYER");
|
||||
#endif
|
||||
|
||||
#undef SetStrItem
|
||||
|
||||
if (PyErr_Occurred()) {
|
||||
Py_CLEAR(build_options);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return build_options;
|
||||
}
|
||||
|
||||
PyObject *BPY_app_build_options_struct(void)
|
||||
{
|
||||
PyObject *ret;
|
||||
|
||||
ret = make_build_options();
|
||||
|
||||
return ret;
|
||||
}
|
||||
32
source/blender/python/intern/bpy_app_build_options.h
Normal file
32
source/blender/python/intern/bpy_app_build_options.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* Contributor(s): Bastien Montagne
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file blender/python/intern/bpy_app_build_options.h
|
||||
* \ingroup pythonintern
|
||||
*/
|
||||
|
||||
#ifndef __BPY_APP_BUILD_OPTIONS_H__
|
||||
#define __BPY_APP_BUILD_OPTIONS_H__
|
||||
|
||||
PyObject *BPY_app_build_options_struct(void);
|
||||
|
||||
#endif /* __BPY_APP_BUILD_OPTIONS_H__ */
|
||||
Reference in New Issue
Block a user