diff options
author | Campbell Barton <campbell@blender.org> | 2022-05-20 04:17:34 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-05-20 04:18:49 +0300 |
commit | 42a6c226d03624d880fe480eeaf2fda1bf8f5ab9 (patch) | |
tree | 5af33b6a39babb78d57ef202def1f56163a1dbbc /source/blender/python | |
parent | c1dcc64750f1e86dfc63ae9800e27dca5edf67f0 (diff) |
CMake: fix AUDASPACE disabling WITH_PYTHON for Blender
When AUDASPACE couldn't find NUMPY, it would disable WITH_PYTHON for
the rest of Blender. Now setting the value globally is only done for
standalone AUDASPACE builds. Now it's possible to build Blender with
AUDASPACE & PYTHON but without NUMPY.
While this isn't an especially important configuration to support,
having Python mysteriously disabled is a hassle to troubleshoot.
NOTE: extern/audaspace/CMakeLists.txt has become out sync with the
original [0], it seems this is being maintained in our repository.
[0]: https://github.com/neXyon/audaspace/blob/master/CMakeLists.txt
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/CMakeLists.txt | 7 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt index e4e198ab812..959fbc7ee98 100644 --- a/source/blender/python/intern/CMakeLists.txt +++ b/source/blender/python/intern/CMakeLists.txt @@ -143,10 +143,13 @@ if(WITH_PYTHON_SAFETY) add_definitions(-DWITH_PYTHON_SAFETY) endif() - - if(WITH_AUDASPACE) + # It's possible to build with AUDASPACE (for file IO) but without the `aud` Python API, + # when building without NUMPY so define both `WITH_AUDASPACE` & `DWITH_AUDASPACE_PY`. add_definitions(-DWITH_AUDASPACE) + if(WITH_PYTHON_NUMPY) + add_definitions(-DWITH_AUDASPACE_PY) + endif() endif() if(WITH_BULLET) diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 5c9de638d8a..0ab8b4385e5 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -238,7 +238,7 @@ void BPY_context_set(bContext *C) extern PyObject *Manta_initPython(void); #endif -#ifdef WITH_AUDASPACE +#ifdef WITH_AUDASPACE_PY /* defined in AUD_C-API.cpp */ extern PyObject *AUD_initPython(void); #endif @@ -272,7 +272,7 @@ static struct _inittab bpy_internal_modules[] = { #ifdef WITH_FLUID {"manta", Manta_initPython}, #endif -#ifdef WITH_AUDASPACE +#ifdef WITH_AUDASPACE_PY {"aud", AUD_initPython}, #endif #ifdef WITH_CYCLES |