Cycles: Support logging when building with SCons
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 3 Dec 2014 16:51:55 +0000 (21:51 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 3 Dec 2014 17:46:56 +0000 (22:46 +0500)
Basically, title says ti all, the option is called WITH_BF_CYCLES_LOGGING

build_files/scons/tools/Blender.py
build_files/scons/tools/btools.py
extern/libmv/SConscript
extern/libmv/bundle.sh
intern/cycles/SConscript

index afcc1d06436dc36a52d0458a032f9d52e6afdf95..d09710a28fc75665df589ca09d8c9c495ee5cacc 100755 (executable)
@@ -390,6 +390,10 @@ def creator(env):
         incs.append('#/extern/libmv')
         defs.append('WITH_LIBMV')
 
+    if env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_LOGGING']:
+        incs.append('#/intern/cycles/blender')
+        defs.append('WITH_CYCLES_LOGGING')
+
     if env['WITH_BF_FFMPEG']:
         defs.append('WITH_FFMPEG')
 
index 7857b7bb222b9c71149e69a8cc438c6965e6c081..25f7f0fb3d13d85290b5447459fc5042ecdde8d4 100644 (file)
@@ -197,7 +197,7 @@ def validate_arguments(args, bc):
             'C_WARN', 'CC_WARN', 'CXX_WARN',
             'LLIBS', 'PLATFORM_LINKFLAGS', 'MACOSX_ARCHITECTURE', 'MACOSX_SDK', 'XCODE_CUR_VER', 'C_COMPILER_ID',
             'BF_CYCLES_CUDA_BINARIES_ARCH', 'BF_PROGRAM_LINKFLAGS', 'MACOSX_DEPLOYMENT_TARGET',
-            'WITH_BF_CYCLES_DEBUG'
+            'WITH_BF_CYCLES_DEBUG', 'WITH_BF_CYCLES_LOGGING'
     ]
 
 
@@ -605,6 +605,7 @@ def read_opts(env, cfg, args):
         ('BF_CYCLES_CUDA_ENV', 'preset environement nvcc will execute in', ''),
         ('BF_CYCLES_CUDA_BINARIES_ARCH', 'CUDA architectures to compile binaries for', []),
         (BoolVariable('WITH_BF_CYCLES_DEBUG', 'Build Cycles engine with extra debugging capabilities', False)),
+        (BoolVariable('WITH_BF_CYCLES_LOGGING', 'Build Cycles engine with logging support', False)),
 
         (BoolVariable('WITH_BF_OIIO', 'Build with OpenImageIO', False)),
         (BoolVariable('WITH_BF_STATICOIIO', 'Statically link to OpenImageIO', False)),
index 96282f3c3c20c33ccf5b98f40eb9feaad3cdabb3..c3e6a4b621d1727430eec938680651b093f164b2 100644 (file)
@@ -46,17 +46,24 @@ if env['WITH_BF_LIBMV']:
         if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
             incs += ' ./third_party/msinttypes'
 
-        src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_logging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is_on.cc']
-        src += ['./third_party/glog/src/windows/port.cc']
     else:
-        src += env.Glob("third_party/glog/src/*.cc")
         incs += ' ./third_party/glog/src'
 else:
     src = env.Glob("intern/stub.cc")
 
 src = [src for src in src if src.find('_test.cc') == -1]
 
-env.BlenderLib ( libname = 'extern_libmv', sources=src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137] )
+env.BlenderLib(libname = 'extern_libmv', sources=src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137])
+
+if env['WITH_BF_LIBMV'] or (env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_LOGGING']):
+    glog_src = []
+    if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
+        glog_src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_logging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is_on.cc']
+        glog_src += ['./third_party/glog/src/windows/port.cc']
+    else:
+        glog_src += env.Glob("third_party/glog/src/*.cc")
+
+    env.BlenderLib(libname = 'extern_glog', sources=glog_src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137])
 
 if env['WITH_BF_LIBMV']:
     SConscript(['third_party/SConscript'])
index 45b0e27f126c68198b442a35c8351b80493c2afb..e467cc98371db6f541390dfd4273499df33d7114 100755 (executable)
@@ -213,7 +213,7 @@ ${tests}
        endif()
 else()
        list(APPEND SRC
-               libmv-capi_stub.cc
+               intern/stub.cc
        )
 endif()
 
@@ -321,17 +321,24 @@ $src
         if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
             incs += ' ./third_party/msinttypes'
 ${win_src}
-        src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_logging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is_on.cc']
-        src += ['./third_party/glog/src/windows/port.cc']
     else:
-        src += env.Glob("third_party/glog/src/*.cc")
         incs += ' ./third_party/glog/src'
 else:
     src = env.Glob("intern/stub.cc")
 
 src = [src for src in src if src.find('_test.cc') == -1]
 
-env.BlenderLib ( libname = 'extern_libmv', sources=src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137] )
+env.BlenderLib(libname = 'extern_libmv', sources=src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137])
+
+if env['WITH_BF_LIBMV'] or (env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_LOGGING']):
+    glog_src = []
+    if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
+        glog_src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_logging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is_on.cc']
+        glog_src += ['./third_party/glog/src/windows/port.cc']
+    else:
+        glog_src += env.Glob("third_party/glog/src/*.cc")
+
+    env.BlenderLib(libname = 'extern_glog', sources=glog_src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137])
 
 if env['WITH_BF_LIBMV']:
     SConscript(['third_party/SConscript'])
index 0d35ebfbc1191412e6c7606f3d966bff6b300631..15a02881ec2f9c2619015980a90eea701a9b6b1a 100644 (file)
@@ -62,6 +62,16 @@ if env['WITH_BF_CYCLES_OSL']:
 if env['WITH_BF_CYCLES_DEBUG']:
     defs.append('WITH_CYCLES_DEBUG')
 
+if env['WITH_BF_CYCLES_LOGGING']:
+    defs.append('WITH_CYCLES_LOGGING')
+    defs.append('GOOGLE_GLOG_DLL_DECL=')
+    if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
+        incs.append('#extern/libmv/third_party/glog/src/windows')
+        incs.append('#extern/libmv/third_party/gflags')
+    else:
+        incs.append('#extern/libmv/third_party/glog/src')
+        incs.append('#extern/libmv/third_party/gflags')
+
 incs.extend('. bvh render device kernel kernel/osl kernel/svm util subd'.split())
 incs.extend('#intern/guardedalloc #source/blender/makesrna #source/blender/makesdna #source/blender/blenlib'.split())
 incs.extend('#source/blender/blenloader ../../source/blender/makesrna/intern'.split())