diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/creator/CMakeLists.txt | 5 | ||||
-rw-r--r-- | source/creator/creator.c | 23 |
2 files changed, 28 insertions, 0 deletions
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 6ed87f6596c..35cbff33342 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -48,6 +48,11 @@ if(WITH_LIBMV) add_definitions(-DWITH_LIBMV) endif() +if(WITH_CYCLES AND WITH_CYCLES_LOGGING) + blender_include_dirs(../../intern/cycles/blender) + add_definitions(-DWITH_CYCLES_LOGGING) +endif() + if(WITH_CODEC_FFMPEG) add_definitions(-DWITH_FFMPEG) endif() diff --git a/source/creator/creator.c b/source/creator/creator.c index 3937ae18143..3511c9dc2cb 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -149,6 +149,10 @@ # include "libmv-capi.h" #endif +#ifdef WITH_CYCLES_LOGGING +# include "CCL_api.h" +#endif + /* from buildinfo.c */ #ifdef BUILD_DATE extern char build_date[]; @@ -309,6 +313,9 @@ static int print_help(int UNUSED(argc), const char **UNUSED(argv), void *data) #ifdef WITH_LIBMV BLI_argsPrintArgDoc(ba, "--debug-libmv"); #endif +#ifdef WITH_CYCLES_LOGGING + BLI_argsPrintArgDoc(ba, "--debug-cycles"); +#endif BLI_argsPrintArgDoc(ba, "--debug-memory"); BLI_argsPrintArgDoc(ba, "--debug-jobs"); BLI_argsPrintArgDoc(ba, "--debug-python"); @@ -450,6 +457,15 @@ static int debug_mode_libmv(int UNUSED(argc), const char **UNUSED(argv), void *U } #endif +#ifdef WITH_CYCLES_LOGGING +static int debug_mode_cycles(int UNUSED(argc), const char **UNUSED(argv), + void *UNUSED(data)) +{ + CCL_start_debug_logging(); + return 0; +} +#endif + static int debug_mode_memory(int UNUSED(argc), const char **UNUSED(argv), void *UNUSED(data)) { MEM_set_memory_debug(); @@ -887,6 +903,8 @@ static int set_verbosity(int argc, const char **argv, void *UNUSED(data)) #ifdef WITH_LIBMV libmv_setLoggingVerbosity(level); +#elif defined(WITH_CYCLES_LOGGING) + CCL_logging_verbosity_set(level); #else (void)level; #endif @@ -1419,6 +1437,9 @@ static void setupArguments(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle) #ifdef WITH_LIBMV BLI_argsAdd(ba, 1, NULL, "--debug-libmv", "\n\tEnable debug messages from libmv library", debug_mode_libmv, NULL); #endif +#ifdef WITH_CYCLES_LOGGING + BLI_argsAdd(ba, 1, NULL, "--debug-cycles", "\n\tEnable debug messages from Cycles", debug_mode_cycles, NULL); +#endif BLI_argsAdd(ba, 1, NULL, "--debug-memory", "\n\tEnable fully guarded memory allocation and debugging", debug_mode_memory, NULL); BLI_argsAdd(ba, 1, NULL, "--debug-value", "<value>\n\tSet debug value of <value> on startup\n", set_debug_value, NULL); @@ -1583,6 +1604,8 @@ int main( #ifdef WITH_LIBMV libmv_initLogging(argv[0]); +#elif defined(WITH_CYCLES_DEBUG) + CCL_init_logging(argv[0]); #endif setCallbacks(); |