Modifier compilation tweaks (Blender conference commit)
authorThomas Dinges <blender@dingto.org>
Sat, 29 Oct 2011 23:56:07 +0000 (23:56 +0000)
committerThomas Dinges <blender@dingto.org>
Sat, 29 Oct 2011 23:56:07 +0000 (23:56 +0000)
* Fluid compilation: Inverse the compile flag from DISABLE_ELBEEM to WITH_MOD_FLUID for consistency. (scons/cmake)
* Use WITH_BF_FLUID in your user config (scons)

* Add support for scons to disable build with Decimate and Boolean modifier.
(WITH_BF_DECIMATE and WITH_BF_BOOLEAN)

14 files changed:
SConstruct
build_files/scons/tools/btools.py
intern/SConscript
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/SConscript
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/particle_system.c
source/blender/editors/physics/CMakeLists.txt
source/blender/editors/physics/physics_fluid.c
source/blender/makesrna/intern/CMakeLists.txt
source/blender/makesrna/intern/rna_fluidsim.c
source/blender/modifiers/CMakeLists.txt
source/blender/modifiers/SConscript
source/blender/modifiers/intern/MOD_fluidsim_util.c

index 93787cd..16ce8ca 100644 (file)
@@ -253,7 +253,9 @@ if 'blenderlite' in B.targets:
     target_env_defs['WITH_BF_BULLET'] = False
     target_env_defs['WITH_BF_BINRELOC'] = False
     target_env_defs['BF_BUILDINFO'] = False
-    target_env_defs['BF_NO_ELBEEM'] = True
+    target_env_defs['WITH_BF_FLUID'] = False
+    target_env_defs['WITH_BF_DECIMATE'] = False
+    target_env_defs['WITH_BF_BOOLEAN'] = False
     target_env_defs['WITH_BF_PYTHON'] = False
     target_env_defs['WITH_BF_3DMOUSE'] = False
     
@@ -323,9 +325,9 @@ if 'blenderplayer' in B.targets:
 if 'blendernogame' in B.targets:
     env['WITH_BF_GAMEENGINE'] = False
 
-# disable elbeem (fluidsim) compilation?
-if env['BF_NO_ELBEEM'] == 1:
-    env['CPPFLAGS'].append('-DDISABLE_ELBEEM')
+# build without elbeem (fluidsim)?
+if env['WITH_BF_FLUID'] == 1:
+    env['CPPFLAGS'].append('-DWITH_MOD_FLUID')
 
 
 if btools.ENDIAN == "big":
index 49efa59..a678bc6 100644 (file)
@@ -150,7 +150,9 @@ def validate_arguments(args, bc):
             'BF_GHOST_DEBUG',
             'WITH_BF_RAYOPTIMIZATION',
             'BF_RAYOPTIMIZATION_SSE_FLAGS',
-            'BF_NO_ELBEEM',
+            'WITH_BF_FLUID',
+            'WITH_BF_DECIMATE',
+            'WITH_BF_BOOLEAN',
             'WITH_BF_CXX_GUARDEDALLOC',
             'WITH_BF_JEMALLOC', 'WITH_BF_STATICJEMALLOC', 'BF_JEMALLOC', 'BF_JEMALLOC_INC', 'BF_JEMALLOC_LIBPATH', 'BF_JEMALLOC_LIB', 'BF_JEMALLOC_LIB_STATIC',
             'BUILDBOT_BRANCH', 'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC'
@@ -250,7 +252,9 @@ def read_opts(env, cfg, args):
         (BoolVariable('WITH_OSX_STATICPYTHON', 'Staticly link to python', True)),
         ('BF_PYTHON_ABI_FLAGS', 'Python ABI flags (suffix in library version: m, mu, etc)', ''),
 
-        (BoolVariable('BF_NO_ELBEEM', 'Disable Fluid Sim', False)),
+        (BoolVariable('WITH_BF_FLUID', 'Build with Fluid simulation (Elbeem)', True)),
+        (BoolVariable('WITH_BF_DECIMATE', 'Build with decimate modifier', True)),
+        (BoolVariable('WITH_BF_BOOLEAN', 'Build with boolean modifier', True)),
         ('BF_PROFILE_FLAGS', 'Profiling compiler flags', ''),
         (BoolVariable('WITH_BF_OPENAL', 'Use OpenAL if true', False)),
         ('BF_OPENAL', 'base path for OpenAL', ''),
index 9a78f8d..da245c7 100644 (file)
@@ -22,7 +22,7 @@ SConscript(['audaspace/SConscript',
 # perhaps get rid of intern/csg?
 NEW_CSG='false'
 
-if not env['BF_NO_ELBEEM']:
+if env['WITH_BF_FLUID']:
     SConscript(['elbeem/SConscript'])
 
 if NEW_CSG=='false':
index 1930e72..1b98dd9 100644 (file)
@@ -323,8 +323,8 @@ if(WITH_OPENMP)
        add_definitions(-DPARALLEL=1)
 endif()
 
-if(NOT WITH_MOD_FLUID)
-       add_definitions(-DDISABLE_ELBEEM)
+if(WITH_MOD_FLUID)
+       add_definitions(-DWITH_MOD_FLUID)
 endif()
 
 if(WITH_MOD_SMOKE)
index 512eec4..ebb0935 100644 (file)
@@ -79,8 +79,8 @@ if env['OURPLATFORM'] == 'darwin':
     if env['WITH_BF_OPENMP']:
        defs.append('PARALLEL=1')
 
-if env['BF_NO_ELBEEM']:
-    defs.append('DISABLE_ELBEEM')
+if env['WITH_BF_FLUID']:
+    defs.append('WITH_MOD_FLUID')
 
 if env['WITH_BF_LZO']:
     incs += ' #/extern/lzo/minilzo'
index c4543df..bb14a1d 100644 (file)
 #include "RE_shader_ext.h"
 
 /* fluid sim particle import */
-#ifndef DISABLE_ELBEEM
+#ifdef WITH_MOD_FLUID
 #include "DNA_object_fluidsim.h"
 #include "LBM_fluidsim.h"
 #include <zlib.h>
 #include <string.h>
-#endif // DISABLE_ELBEEM
+#endif // WITH_MOD_FLUID
 
 //XXX #include "BIF_screen.h"
 
index f904f24..ec058b2 100644 (file)
 #include "RE_shader_ext.h"
 
 /* fluid sim particle import */
-#ifndef DISABLE_ELBEEM
+#ifdef WITH_MOD_FLUID
 #include "DNA_object_fluidsim.h"
 #include "LBM_fluidsim.h"
 #include <zlib.h>
 #include <string.h>
 
-#endif // DISABLE_ELBEEM
+#endif // WITH_MOD_FLUID
 
 /************************************************/
 /*                     Reacting to system events                       */
@@ -3916,7 +3916,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
        }
 
        /* fluid sim particle import handling, actual loading of particles from file */
-       #ifndef DISABLE_ELBEEM
+       #ifdef WITH_MOD_FLUID
        {
                FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(sim->ob, eModifierType_Fluidsim);
                
@@ -4009,7 +4009,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
                        
                } // fluid sim particles done
        }
-       #endif // DISABLE_ELBEEM
+       #endif // WITH_MOD_FLUID
 }
 
 static int emit_particles(ParticleSimulationData *sim, PTCacheID *pid, float UNUSED(cfra))
index f98122e..382e12c 100644 (file)
@@ -45,8 +45,8 @@ set(SRC
        physics_intern.h
 )
 
-if(NOT WITH_MOD_FLUID)
-       add_definitions(-DDISABLE_ELBEEM)
+if(WITH_MOD_FLUID)
+       add_definitions(-DWITH_MOD_FLUID)
 endif()
 
 if(WITH_OPENMP)
index f0c327b..6e88d47 100644 (file)
@@ -85,7 +85,7 @@
 #include "physics_intern.h" // own include
 
 /* enable/disable overall compilation */
-#ifndef DISABLE_ELBEEM
+#ifdef WITH_MOD_FLUID
 
 #include "WM_api.h"
 
@@ -1111,7 +1111,7 @@ void fluidsimFreeBake(Object *UNUSED(ob))
        /* not implemented yet */
 }
 
-#else /* DISABLE_ELBEEM */
+#else /* WITH_MOD_FLUID */
 
 /* compile dummy functions for disabled fluid sim */
 
@@ -1135,7 +1135,7 @@ static int fluidsimBake(bContext *UNUSED(C), ReportList *UNUSED(reports), Object
        return 0;
 }
 
-#endif /* DISABLE_ELBEEM */
+#endif /* WITH_MOD_FLUID */
 
 /***************************** Operators ******************************/
 
index 59b2513..ab69add 100644 (file)
@@ -195,8 +195,8 @@ if(WITH_CODEC_FFMPEG)
        add_definitions(-DWITH_FFMPEG)
 endif()
 
-if(NOT WITH_MOD_FLUID)
-       add_definitions(-DDISABLE_ELBEEM)
+if(WITH_MOD_FLUID)
+       add_definitions(-DWITH_MOD_FLUID)
 endif()
 
 if(WITH_FFTW3)
index d2d24e0..a7eedf5 100644 (file)
@@ -170,7 +170,7 @@ static void rna_FluidSettings_update_type(Main *bmain, Scene *scene, PointerRNA
 
 static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *value)
 {
-#ifdef DISABLE_ELBEEM
+#ifndef WITH_MOD_FLUID
        (void)ptr;
        value[0]= '\0';
 #else
@@ -183,7 +183,7 @@ static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *v
 
 static int rna_DomainFluidSettings_memory_estimate_length(PointerRNA *UNUSED(ptr))
 {
-#ifdef DISABLE_ELBEEM
+#ifndef WITH_MOD_FLUID
        return 0;
 #else
        return 31;
index 7e06ef1..805cd91 100644 (file)
@@ -111,8 +111,8 @@ if(WITH_MOD_DECIMATE)
        )
 endif()
 
-if(NOT WITH_MOD_FLUID)
-       add_definitions(-DDISABLE_ELBEEM)
+if(WITH_MOD_FLUID)
+       add_definitions(-DWITH_MOD_FLUID)
 endif()
 
 if(WITH_GAMEENGINE)
index 77a2d57..277ed2c 100644 (file)
@@ -13,12 +13,14 @@ incs += ' ' + env['BF_ZLIB_INC']
 
 defs = []
 
-# could be made optional
-defs += ['WITH_MOD_BOOLEAN']
-defs += ['WITH_MOD_DECIMATE']
+if env ['WITH_BF_BOOLEAN']:
+    defs.append('WITH_MOD_BOOLEAN')
 
-if env['BF_NO_ELBEEM']:
-    defs.append('DISABLE_ELBEEM')
+if env ['WITH_BF_DECIMATE']:
+    defs.append('WITH_MOD_DECIMATE')
+
+if env['WITH_BF_FLUID']:
+    defs.append('WITH_MOD_FLUID')
 
 if env['WITH_BF_GAMEENGINE']:
     incs += ' #/extern/recastnavigation'
index 0e9b71c..1baa03d 100644 (file)
 // headers for fluidsim bobj meshes
 #include "LBM_fluidsim.h"
 
+
 void fluidsim_init(FluidsimModifierData *fluidmd)
 {
-#ifndef DISABLE_ELBEEM
+#ifdef WITH_MOD_FLUID
        if(fluidmd)
        {
                FluidsimSettings *fss = MEM_callocN(sizeof(FluidsimSettings), "fluidsimsettings");
@@ -152,7 +153,7 @@ void fluidsim_init(FluidsimModifierData *fluidmd)
 
 void fluidsim_free(FluidsimModifierData *fluidmd)
 {
-#ifndef DISABLE_ELBEEM
+#ifdef WITH_MOD_FLUID
        if(fluidmd)
        {
                if(fluidmd->fss->meshVelocities)
@@ -169,7 +170,7 @@ void fluidsim_free(FluidsimModifierData *fluidmd)
        return;
 }
 
-#ifndef DISABLE_ELBEEM
+#ifdef WITH_MOD_FLUID
 /* read .bobj.gz file into a fluidsimDerivedMesh struct */
 static DerivedMesh *fluidsim_read_obj(const char *filename)
 {
@@ -534,14 +535,14 @@ static DerivedMesh *fluidsim_read_cache(DerivedMesh *orgdm, FluidsimModifierData
 
        return dm;
 }
-#endif // DISABLE_ELBEEM
+#endif // WITH_MOD_FLUID
 
 DerivedMesh *fluidsimModifier_do(FluidsimModifierData *fluidmd, Scene *scene,
                                                Object *UNUSED(ob),
                                                DerivedMesh *dm,
                                                int useRenderParams, int UNUSED(isFinalCalc))
 {
-#ifndef DISABLE_ELBEEM
+#ifdef WITH_MOD_FLUID
        DerivedMesh *result = NULL;
        int framenr;
        FluidsimSettings *fss = NULL;