[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41169] trunk/blender: cleanup scons build flags, many duplicates because because of confusion between CFLAGS/CPPFLAGS/ CCFLAGS/CXXFLAGS, devs would set multiple to be on the safe side.

Campbell Barton ideasman42 at gmail.com
Fri Oct 21 06:23:28 CEST 2011


Revision: 41169
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41169
Author:   campbellbarton
Date:     2011-10-21 04:23:26 +0000 (Fri, 21 Oct 2011)
Log Message:
-----------
cleanup scons build flags, many duplicates because because of confusion between CFLAGS/CPPFLAGS/CCFLAGS/CXXFLAGS, devs would set multiple to be on the safe side.
- defines go in CPPFLAGS
- C & C++ flags go in CCFLAGS
- CFLAGS / CXXFLAGS are C OR C++ only.

also commented intended ghost unicode/ascii usage.

Modified Paths:
--------------
    trunk/blender/SConstruct
    trunk/blender/build_files/buildbot/config/user-config-i686.py
    trunk/blender/build_files/buildbot/config/user-config-player-i686.py
    trunk/blender/build_files/buildbot/config/user-config-player-x86_64.py
    trunk/blender/build_files/buildbot/config/user-config-x86_64.py
    trunk/blender/build_files/scons/config/aix4-config.py
    trunk/blender/build_files/scons/config/darwin-config.py
    trunk/blender/build_files/scons/config/freebsd7-config.py
    trunk/blender/build_files/scons/config/freebsd8-config.py
    trunk/blender/build_files/scons/config/freebsd9-config.py
    trunk/blender/build_files/scons/config/linux-config.py
    trunk/blender/build_files/scons/config/linuxcross-config.py
    trunk/blender/build_files/scons/config/openbsd3-config.py
    trunk/blender/build_files/scons/config/sunos5-config.py
    trunk/blender/build_files/scons/config/win32-mingw-config.py
    trunk/blender/build_files/scons/config/win32-vc-config.py
    trunk/blender/build_files/scons/config/win64-vc-config.py
    trunk/blender/intern/ghost/GHOST_Types.h

Modified: trunk/blender/SConstruct
===================================================================
--- trunk/blender/SConstruct	2011-10-21 03:16:01 UTC (rev 41168)
+++ trunk/blender/SConstruct	2011-10-21 04:23:26 UTC (rev 41169)
@@ -30,7 +30,6 @@
 # Then read all SConscripts and build
 #
 # TODO: fix /FORCE:MULTIPLE on windows to get proper debug builds.
-# TODO: cleanup CCFLAGS / CPPFLAGS use, often both are set when we only need one.
 
 import platform as pltfrm
 
@@ -210,7 +209,7 @@
 
 if sys.platform=='win32':
     if bitness==64:
-        env.Append(CFLAGS=['-DWIN64']) # -DWIN32 needed too, as it's used all over to target Windows generally
+        env.Append(CPPFLAGS=['-DWIN64']) # -DWIN32 needed too, as it's used all over to target Windows generally
 
 if not env['BF_FANCY']:
     B.bc.disable()
@@ -283,22 +282,17 @@
 if env['WITH_BF_OPENMP'] == 1:
         if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
                 env['CCFLAGS'].append('/openmp')
-                env['CPPFLAGS'].append('/openmp')
         else:
             if env['CC'].endswith('icc'): # to be able to handle CC=/opt/bla/icc case
                 env.Append(LINKFLAGS=['-openmp', '-static-intel'])
                 env['CCFLAGS'].append('-openmp')
-                env['CPPFLAGS'].append('-openmp')
             else:
                 env.Append(CCFLAGS=['-fopenmp']) 
-                env.Append(CPPFLAGS=['-fopenmp'])
 
 if env['WITH_GHOST_COCOA'] == True:
-    env.Append(CFLAGS=['-DGHOST_COCOA']) 
-    env.Append(CPPFLAGS=['-DGHOST_COCOA'])
+    env.Append(CPPFLAGS=['-DGHOST_COCOA']) 
     
 if env['USE_QTKIT'] == True:
-    env.Append(CFLAGS=['-DUSE_QTKIT'])
     env.Append(CPPFLAGS=['-DUSE_QTKIT'])
 
 #check for additional debug libnames
@@ -330,20 +324,15 @@
 # disable elbeem (fluidsim) compilation?
 if env['BF_NO_ELBEEM'] == 1:
     env['CPPFLAGS'].append('-DDISABLE_ELBEEM')
-    env['CCFLAGS'].append('-DDISABLE_ELBEEM')
 
 
 if btools.ENDIAN == "big":
     env['CPPFLAGS'].append('-D__BIG_ENDIAN__')
-    env['CCFLAGS'].append('-D__BIG_ENDIAN__')
 else:
     env['CPPFLAGS'].append('-D__LITTLE_ENDIAN__')
-    env['CCFLAGS'].append('-D__LITTLE_ENDIAN__')	
 
-
 # TODO, make optional
 env['CPPFLAGS'].append('-DWITH_AUDASPACE')
-env['CCFLAGS'].append('-DWITH_AUDASPACE')
 
 # lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
 B.root_build_dir = env['BF_BUILDDIR']

Modified: trunk/blender/build_files/buildbot/config/user-config-i686.py
===================================================================
--- trunk/blender/build_files/buildbot/config/user-config-i686.py	2011-10-21 03:16:01 UTC (rev 41168)
+++ trunk/blender/build_files/buildbot/config/user-config-i686.py	2011-10-21 04:23:26 UTC (rev 41169)
@@ -94,6 +94,7 @@
 
 # Compilation and optimization
 BF_DEBUG = False
-REL_CFLAGS = ['-O2']
-REL_CCFLAGS = ['-O2']
+REL_CFLAGS = []
+REL_CXXFLAGS = []
+REL_CCFLAGS = ['-O2']  # C & C++
 PLATFORM_LINKFLAGS = ['-L/home/sources/staticlibs/lib32']

Modified: trunk/blender/build_files/buildbot/config/user-config-player-i686.py
===================================================================
--- trunk/blender/build_files/buildbot/config/user-config-player-i686.py	2011-10-21 03:16:01 UTC (rev 41168)
+++ trunk/blender/build_files/buildbot/config/user-config-player-i686.py	2011-10-21 04:23:26 UTC (rev 41169)
@@ -85,6 +85,7 @@
 
 # Compilation and optimization
 BF_DEBUG = False
-REL_CFLAGS = ['-O2']
-REL_CCFLAGS = ['-O2']
+REL_CFLAGS = []
+REL_CXXFLAGS = []
+REL_CCFLAGS = ['-O2']  # C & C++
 PLATFORM_LINKFLAGS = ['-L/home/sources/staticlibs/lib32']

Modified: trunk/blender/build_files/buildbot/config/user-config-player-x86_64.py
===================================================================
--- trunk/blender/build_files/buildbot/config/user-config-player-x86_64.py	2011-10-21 03:16:01 UTC (rev 41168)
+++ trunk/blender/build_files/buildbot/config/user-config-player-x86_64.py	2011-10-21 04:23:26 UTC (rev 41169)
@@ -85,6 +85,7 @@
 
 # Compilation and optimization
 BF_DEBUG = False
-REL_CFLAGS = ['-O2']
-REL_CCFLAGS = ['-O2']
+REL_CFLAGS = []
+REL_CXXFLAGS = []
+REL_CCFLAGS = ['-O2']  # C & C++
 PLATFORM_LINKFLAGS = ['-L/home/sources/staticlibs/lib64']

Modified: trunk/blender/build_files/buildbot/config/user-config-x86_64.py
===================================================================
--- trunk/blender/build_files/buildbot/config/user-config-x86_64.py	2011-10-21 03:16:01 UTC (rev 41168)
+++ trunk/blender/build_files/buildbot/config/user-config-x86_64.py	2011-10-21 04:23:26 UTC (rev 41169)
@@ -94,6 +94,7 @@
 
 # Compilation and optimization
 BF_DEBUG = False
-REL_CFLAGS = ['-O2']
-REL_CCFLAGS = ['-O2']
+REL_CFLAGS = []
+REL_CXXFLAGS = []
+REL_CCFLAGS = ['-O2']  # C & C++
 PLATFORM_LINKFLAGS = ['-L/home/sources/staticlibs/lib64']

Modified: trunk/blender/build_files/scons/config/aix4-config.py
===================================================================
--- trunk/blender/build_files/scons/config/aix4-config.py	2011-10-21 03:16:01 UTC (rev 41168)
+++ trunk/blender/build_files/scons/config/aix4-config.py	2011-10-21 04:23:26 UTC (rev 41169)
@@ -156,15 +156,17 @@
 CC = 'gcc'
 CXX = 'g++'
 
-CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
+CCFLAGS = ['-pipe', '-funsigned-char', '-fno-strict-aliasing']
 
-CPPFLAGS = [ '-DXP_UNIX', '-DWIN32', '-DFREE_WINDOWS' ]
-CXXFLAGS = ['-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
-REL_CFLAGS = ['-DNDEBUG', '-O2' ]
+CPPFLAGS = ['-DXP_UNIX', '-DWIN32', '-DFREE_WINDOWS']
+CXXFLAGS = []
+
+REL_CFLAGS = []
+REL_CXXFLAGS = []
 REL_CCFLAGS = ['-DNDEBUG', '-O2' ]
-C_WARN = [ '-Wall' , '-Wno-char-subscripts', '-Wdeclaration-after-statement' ]
 
-CC_WARN = [ '-Wall' ]
+C_WARN = ['-Wall' , '-Wno-char-subscripts', '-Wdeclaration-after-statement']
+CC_WARN = ['-Wall']
 
 
 

Modified: trunk/blender/build_files/scons/config/darwin-config.py
===================================================================
--- trunk/blender/build_files/scons/config/darwin-config.py	2011-10-21 03:16:01 UTC (rev 41168)
+++ trunk/blender/build_files/scons/config/darwin-config.py	2011-10-21 04:23:26 UTC (rev 41169)
@@ -306,11 +306,11 @@
 else:
 	ARCH_FLAGS = ['-m32']
 
-CFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS
+CFLAGS = []
+CXXFLAGS = []
+CCFLAGS = ['-pipe','-funsigned-char']
 
-CPPFLAGS = []+ARCH_FLAGS
-CCFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS
-CXXFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS
+CPPFLAGS = list(ARCH_FLAGS)
 
 if WITH_GHOST_COCOA:
 	PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Cocoa','-framework','Carbon','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','OpenAL']+ARCH_FLAGS
@@ -336,9 +336,8 @@
 
 # some flags shuffling for different OS versions
 if MAC_MIN_VERS == '10.3':
-	CFLAGS = ['-fuse-cxa-atexit']+CFLAGS
-	CXXFLAGS = ['-fuse-cxa-atexit']+CXXFLAGS
-	PLATFORM_LINKFLAGS = ['-fuse-cxa-atexit']+PLATFORM_LINKFLAGS
+	CCFLAGS = ['-fuse-cxa-atexit'] + CFLAGS
+	PLATFORM_LINKFLAGS = ['-fuse-cxa-atexit'] + PLATFORM_LINKFLAGS
 	LLIBS.append('crt3.o')
 	
 if USE_SDK:
@@ -349,19 +348,18 @@
 
 #Intel Macs are CoreDuo and Up	
 if MACOSX_ARCHITECTURE == 'i386' or MACOSX_ARCHITECTURE == 'x86_64':
-	REL_CFLAGS = ['-DNDEBUG', '-O2','-ftree-vectorize','-msse','-msse2','-msse3','-mfpmath=sse']
+	REL_CFLAGS = []
+	REL_CXXFLAGS = []
 	REL_CCFLAGS = ['-DNDEBUG', '-O2','-ftree-vectorize','-msse','-msse2','-msse3','-mfpmath=sse']
 else:
-	CFLAGS = CFLAGS+['-fno-strict-aliasing']
-	CCFLAGS =  CCFLAGS+['-fno-strict-aliasing']
-	CXXFLAGS = CXXFLAGS+['-fno-strict-aliasing']
-	REL_CFLAGS = ['-DNDEBUG', '-O2']
+	CCFLAGS += ['-fno-strict-aliasing']
+	REL_CFLAGS = []
+	REL_CXXFLAGS = []
 	REL_CCFLAGS = ['-DNDEBUG', '-O2']
 
 # Intel 64bit Macs are Core2Duo and up
 if MACOSX_ARCHITECTURE == 'x86_64':
-	REL_CFLAGS = REL_CFLAGS+['-march=core2','-mssse3','-with-tune=core2','-enable-threads']
-	REL_CCFLAGS = REL_CCFLAGS+['-march=core2','-mssse3','-with-tune=core2','-enable-threads']
+	REL_CCFLAGS += ['-march=core2','-mssse3','-with-tune=core2','-enable-threads']
 
 CC_WARN = ['-Wall']
 C_WARN = ['-Wno-char-subscripts', '-Wpointer-arith', '-Wcast-align', '-Wdeclaration-after-statement', '-Wno-unknown-pragmas', '-Wstrict-prototypes']

Modified: trunk/blender/build_files/scons/config/freebsd7-config.py
===================================================================
--- trunk/blender/build_files/scons/config/freebsd7-config.py	2011-10-21 03:16:01 UTC (rev 41168)
+++ trunk/blender/build_files/scons/config/freebsd7-config.py	2011-10-21 04:23:26 UTC (rev 41169)
@@ -172,11 +172,12 @@
 CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
 
 CPPFLAGS = []
-CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
+CXXFLAGS = []
 if WITH_BF_FFMPEG:
   # libavutil needs UINT64_C()
   CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ]
-REL_CFLAGS = ['-DNDEBUG', '-O2']
+REL_CFLAGS = []
+REL_CXXFLAGS = []
 REL_CCFLAGS = ['-DNDEBUG', '-O2']
 ##BF_DEPEND = True
 ##

Modified: trunk/blender/build_files/scons/config/freebsd8-config.py
===================================================================
--- trunk/blender/build_files/scons/config/freebsd8-config.py	2011-10-21 03:16:01 UTC (rev 41168)
+++ trunk/blender/build_files/scons/config/freebsd8-config.py	2011-10-21 04:23:26 UTC (rev 41169)
@@ -172,11 +172,12 @@
 CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
 
 CPPFLAGS = []
-CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
+CXXFLAGS = []
 if WITH_BF_FFMPEG:
   # libavutil needs UINT64_C()
   CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ]
-REL_CFLAGS = ['-DNDEBUG', '-O2']
+REL_CFLAGS = []
+REL_CXXFLAGS = []
 REL_CCFLAGS = ['-DNDEBUG', '-O2']
 ##BF_DEPEND = True
 ##

Modified: trunk/blender/build_files/scons/config/freebsd9-config.py
===================================================================
--- trunk/blender/build_files/scons/config/freebsd9-config.py	2011-10-21 03:16:01 UTC (rev 41168)

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list