diff options
author | Campbell Barton <campbell@blender.org> | 2022-06-07 07:21:19 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-06-08 06:29:32 +0300 |
commit | 8edd1d8aa597514d5089f8cf2aa640ec14c1e389 (patch) | |
tree | ef4513243ab47a0cbc27d298e96d462c8f22396d /source/blender/python | |
parent | a1d2efd190038c7615bd3bb459dc86c8b3a8ecdc (diff) |
CMake: optionally disable OBJ, STL & GPencil SVG support
The following CMake options have been added (enabled by default),
except for the lite build configuration.
- WITH_IO_STL
- WITH_IO_WAVEFRONT_OBJ
- WITH_IO_GPENCIL (for grease pencil SVG importing).
Note that it was already possible to disable grease pencil export
by disabling WITH_PUGIXML & WITH_HARU.
This is intended to keep the lite builds fast and small for building,
linking & execution.
Reviewed By: iyadahmed2001, aras_p, antoniov, mont29
Ref D15141
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/CMakeLists.txt | 12 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_app_build_options.c | 21 |
2 files changed, 33 insertions, 0 deletions
diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt index 8179daa8e03..71138134370 100644 --- a/source/blender/python/intern/CMakeLists.txt +++ b/source/blender/python/intern/CMakeLists.txt @@ -310,6 +310,18 @@ if(WITH_OPENCOLLADA) add_definitions(-DWITH_COLLADA) endif() +if(WITH_IO_WAVEFRONT_OBJ) + add_definitions(-DWITH_IO_WAVEFRONT_OBJ) +endif() + +if(WITH_IO_STL) + add_definitions(-DWITH_IO_STL) +endif() + +if(WITH_IO_GPENCIL) + add_definitions(-DWITH_IO_GPENCIL) +endif() + if(WITH_ALEMBIC) add_definitions(-DWITH_ALEMBIC) endif() diff --git a/source/blender/python/intern/bpy_app_build_options.c b/source/blender/python/intern/bpy_app_build_options.c index beb78753406..fe5111c37f2 100644 --- a/source/blender/python/intern/bpy_app_build_options.c +++ b/source/blender/python/intern/bpy_app_build_options.c @@ -43,6 +43,9 @@ static PyStructSequence_Field app_builtopts_info_fields[] = { {"mod_oceansim", NULL}, {"mod_remesh", NULL}, {"collada", NULL}, + {"io_wavefront_obj", NULL}, + {"io_stl", NULL}, + {"io_gpencil", NULL}, {"opencolorio", NULL}, {"openmp", NULL}, {"openvdb", NULL}, @@ -251,6 +254,24 @@ static PyObject *make_builtopts_info(void) SetObjIncref(Py_False); #endif +#ifdef WITH_IO_WAVEFRONT_OBJ + SetObjIncref(Py_True); +#else + SetObjIncref(Py_False); +#endif + +#ifdef WITH_IO_STL + SetObjIncref(Py_True); +#else + SetObjIncref(Py_False); +#endif + +#ifdef WITH_IO_GPENCIL + SetObjIncref(Py_True); +#else + SetObjIncref(Py_False); +#endif + #ifdef WITH_OCIO SetObjIncref(Py_True); #else |