The string slicing and startswith/endswith checks are quite verbose
and don't read well (also not too flexible), Why not wrap into SCons
utility functions?

CMake has utility functions VERSION_LESS, VERSION_GREATER,
VERSION_EQUAL as well as C/CXX_COMPILER_VERSION so you dont have to
check the compiler argument argument.

This way then gcc4.9 comes out SCons files wont have to be updates to
check for 4.8 and 4.9... which will be the case with SCons/OSX from
what I can tell.



On Thu, Nov 7, 2013 at 10:19 AM, jens verwiebe <[email protected]> wrote:
> Revision: 61181
>           
> http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=61181
> Author:   jensverwiebe
> Date:     2013-11-06 23:19:01 +0000 (Wed, 06 Nov 2013)
> Log Message:
> -----------
> OSX/scons: for completeness, added WITH_BF_OPENMP switch
>
> Modified Paths:
> --------------
>     trunk/blender/SConstruct
>     trunk/blender/build_files/scons/config/darwin-config.py
>
> Modified: trunk/blender/SConstruct
> ===================================================================
> --- trunk/blender/SConstruct    2013-11-06 23:06:11 UTC (rev 61180)
> +++ trunk/blender/SConstruct    2013-11-06 23:19:01 UTC (rev 61181)
> @@ -410,10 +410,11 @@
>
>      #Defaults openMP to true if compiler handles it ( only gcc 4.6.1 and 
> newer )
>      # if your compiler does not have accurate suffix you may have to enable 
> it by hand !
> -    if env['CC'][:-2].endswith('4.6') or env['CC'][:-2].endswith('4.8'):
> -        env['WITH_BF_OPENMP'] = 1  # multithreading for fluids, cloth, 
> sculpt and smoke
> -    else:
> -        env['WITH_BF_OPENMP'] = 0
> +    if env['WITH_BF_OPENMP'] == 1:
> +        if env['CC'][:-2].endswith('4.6') or env['CC'][:-2].endswith('4.8'):
> +            env['WITH_BF_OPENMP'] = 1  # multithreading for fluids, cloth, 
> sculpt and smoke
> +        else:
> +            env['WITH_BF_OPENMP'] = 0
>
>         env['PLATFORM_LINKFLAGS'] = env['PLATFORM_LINKFLAGS']+ARCH_FLAGS
>
>
> Modified: trunk/blender/build_files/scons/config/darwin-config.py
> ===================================================================
> --- trunk/blender/build_files/scons/config/darwin-config.py     2013-11-06 
> 23:06:11 UTC (rev 61180)
> +++ trunk/blender/build_files/scons/config/darwin-config.py     2013-11-06 
> 23:19:01 UTC (rev 61181)
> @@ -211,6 +211,9 @@
>  #Freestyle
>  WITH_BF_FREESTYLE = True
>
> +#OpenMP ( will be checked for compiler support and turned off eventually )
> +WITH_BF_OPENMP = True
> +
>  #Ray trace optimization
>  WITH_BF_RAYOPTIMIZATION = True
>  BF_RAYOPTIMIZATION_SSE_FLAGS = []
>
> _______________________________________________
> Bf-blender-cvs mailing list
> [email protected]
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs



-- 
- Campbell
_______________________________________________
Bf-committers mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-committers

Reply via email to