forked from bartvdbraak/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.
- defines go in CPPFLAGS - C & C++ flags go in CCFLAGS - CFLAGS / CXXFLAGS are C OR C++ only. also commented intended ghost unicode/ascii usage.
This commit is contained in:
parent
78a8f8a4b1
commit
d37760bc34
15
SConstruct
15
SConstruct
@ -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 @@ opts.Update(env)
|
||||
|
||||
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['OURPLATFORM']=='darwin':
|
||||
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 @@ if 'blendernogame' in B.targets:
|
||||
# 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']
|
||||
|
@ -94,6 +94,7 @@ WITH_BF_JACK = True
|
||||
|
||||
# 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']
|
||||
|
@ -85,6 +85,7 @@ WITH_BF_JACK = True
|
||||
|
||||
# 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']
|
||||
|
@ -85,6 +85,7 @@ WITH_BF_JACK = True
|
||||
|
||||
# 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']
|
||||
|
@ -94,6 +94,7 @@ WITH_BF_JACK = True
|
||||
|
||||
# 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']
|
||||
|
@ -156,15 +156,17 @@ BF_OPENGL_LIB_STATIC = '${BF_OPENGL}/libGL.a ${BF_OPENGL}/libGLU.a ${BF_OPENGL}/
|
||||
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']
|
||||
|
||||
|
||||
|
||||
|
@ -306,11 +306,11 @@ if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'ppc64':
|
||||
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 @@ else:
|
||||
|
||||
# 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 @@ if USE_SDK:
|
||||
|
||||
#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']
|
||||
|
@ -172,11 +172,12 @@ BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
|
||||
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
|
||||
##
|
||||
|
@ -172,11 +172,12 @@ BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
|
||||
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
|
||||
##
|
||||
|
@ -170,13 +170,14 @@ WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
|
||||
|
||||
CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
|
||||
CXXFLAGS = []
|
||||
|
||||
CPPFLAGS = []
|
||||
CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
|
||||
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
|
||||
##
|
||||
|
@ -199,15 +199,16 @@ CXX = 'g++'
|
||||
## CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -mieee
|
||||
|
||||
CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
|
||||
CXXFLAGS = []
|
||||
|
||||
CPPFLAGS = []
|
||||
CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
|
||||
# g++ 4.6, only needed for bullet
|
||||
CXXFLAGS += ['-fpermissive']
|
||||
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
|
||||
##
|
||||
|
@ -170,10 +170,11 @@ WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
|
||||
|
||||
CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
|
||||
CXXFLAGS = []
|
||||
|
||||
CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE']
|
||||
CXXFLAGS = ['-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
|
||||
REL_CFLAGS = ['-DNDEBUG', '-O2']
|
||||
REL_CFLAGS = []
|
||||
REL_CXXFLAGS = []
|
||||
REL_CCFLAGS = ['-DNDEBUG', '-O2']
|
||||
C_WARN = ['-Wall', '-Wstrict-prototypes', '-Wno-char-subscripts', '-Wdeclaration-after-statement']
|
||||
|
||||
|
@ -116,8 +116,9 @@ CFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
|
||||
|
||||
CPPFLAGS = []
|
||||
CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
|
||||
CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
|
||||
REL_CFLAGS = ['-DNDEBUG', '-O2']
|
||||
CXXFLAGS = []
|
||||
REL_CFLAGS = []
|
||||
REL_CXXFLAGS = []
|
||||
REL_CCFLAGS = ['-DNDEBUG', '-O2']
|
||||
##BF_DEPEND = True
|
||||
##
|
||||
|
@ -132,8 +132,9 @@ CXX = 'g++'
|
||||
CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
|
||||
|
||||
CPPFLAGS = ['-DSUN_OGL_NO_VERTEX_MACROS']
|
||||
CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
|
||||
REL_CFLAGS = ['-DNDEBUG', '-O2']
|
||||
CXXFLAGS = []
|
||||
REL_CFLAGS = []
|
||||
REL_CXXFLAGS = []
|
||||
REL_CCFLAGS = ['-DNDEBUG', '-O2']
|
||||
##BF_DEPEND = True
|
||||
##
|
||||
|
@ -159,10 +159,11 @@ CC = 'gcc'
|
||||
CXX = 'g++'
|
||||
|
||||
CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
|
||||
CXXFLAGS = []
|
||||
|
||||
CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE']
|
||||
CXXFLAGS = ['-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
|
||||
REL_CFLAGS = ['-DNDEBUG', '-O2']
|
||||
REL_CFLAGS = []
|
||||
REL_CXXFLAGS = []
|
||||
REL_CCFLAGS = ['-DNDEBUG', '-O2']
|
||||
|
||||
C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-prototypes']
|
||||
|
@ -171,9 +171,9 @@ BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast', '/arch:SSE']
|
||||
BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr']
|
||||
|
||||
CPPFLAGS = ['-DWIN32','-D_CONSOLE', '-D_LIB', '-D_CRT_SECURE_NO_DEPRECATE']
|
||||
REL_CFLAGS = ['-O2', '-DNDEBUG']
|
||||
REL_CFLAGS = []
|
||||
REL_CXXFLAGS = []
|
||||
REL_CCFLAGS = ['-O2', '-DNDEBUG']
|
||||
REL_CXXFLAGS = ['-O2', '-DNDEBUG']
|
||||
|
||||
C_WARN = []
|
||||
CC_WARN = []
|
||||
|
@ -175,9 +175,9 @@ BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast']
|
||||
BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr', '/Od']
|
||||
|
||||
CPPFLAGS = ['-DWIN32', '-D_CONSOLE', '-D_LIB', '-D_CRT_SECURE_NO_DEPRECATE']
|
||||
REL_CFLAGS = ['-O2', '-DNDEBUG']
|
||||
REL_CFLAGS = []
|
||||
REL_CXXFLAGS = []
|
||||
REL_CCFLAGS = ['-O2', '-DNDEBUG']
|
||||
REL_CXXFLAGS = ['-O2', '-DNDEBUG']
|
||||
|
||||
C_WARN = []
|
||||
CC_WARN = []
|
||||
|
@ -466,8 +466,19 @@ typedef struct {
|
||||
typedef struct {
|
||||
/** The key code. */
|
||||
GHOST_TKey key;
|
||||
|
||||
/* ascii / utf8: both should always be set when possible,
|
||||
* - ascii may be '\0' however if the user presses a non ascii key
|
||||
* - unicode may not be set if the system has no unicode support
|
||||
*
|
||||
* These values are intended to be used as follows.
|
||||
* For text input use unicode when available, fallback to ascii.
|
||||
* For areas where unicode is not needed, number input for example, always
|
||||
* use ascii, unicode is ignored - campbell.
|
||||
*/
|
||||
/** The ascii code for the key event ('\0' if none). */
|
||||
char ascii;
|
||||
/** The unicode character. if the length is 6, not NULL terminated if all 6 are set */
|
||||
char utf8_buf[6];
|
||||
} GHOST_TEventKeyData;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user