diff options
Diffstat (limited to 'intern/cycles/app')
-rw-r--r-- | intern/cycles/app/CMakeLists.txt | 9 | ||||
-rw-r--r-- | intern/cycles/app/cycles_standalone.cpp | 17 |
2 files changed, 23 insertions, 3 deletions
diff --git a/intern/cycles/app/CMakeLists.txt b/intern/cycles/app/CMakeLists.txt index 63cd0bca4b4..d48ef51ded4 100644 --- a/intern/cycles/app/CMakeLists.txt +++ b/intern/cycles/app/CMakeLists.txt @@ -37,7 +37,14 @@ if(NOT PUGIXML_LIBRARIES STREQUAL "") list(APPEND LIBRARIES ${PUGIXML_LIBRARIES}) endif() -if(NOT CYCLES_STANDALONE_REPOSITORY) +if(CYCLES_STANDALONE_REPOSITORY) + if(WITH_CYCLES_LOGGING) + list(APPEND LIBRARIES + ${GLOG_LIBRARIES} + ${GFLAGS_LIBRARIES} + ) + endif() +else() list(APPEND LIBRARIES bf_intern_glew_mx) endif() diff --git a/intern/cycles/app/cycles_standalone.cpp b/intern/cycles/app/cycles_standalone.cpp index 1950e0b103f..ce3fb966b8c 100644 --- a/intern/cycles/app/cycles_standalone.cpp +++ b/intern/cycles/app/cycles_standalone.cpp @@ -25,6 +25,7 @@ #include "util_args.h" #include "util_foreach.h" #include "util_function.h" +#include "util_logging.h" #include "util_path.h" #include "util_progress.h" #include "util_string.h" @@ -331,7 +332,8 @@ static void options_parse(int argc, const char **argv) /* parse options */ ArgParse ap; - bool help = false; + bool help = false, debug = false; + int verbosity = 1; ap.options ("Usage: cycles [options] file.xml", "%*", files_parse, "", @@ -347,6 +349,10 @@ static void options_parse(int argc, const char **argv) "--width %d", &options.width, "Window width in pixel", "--height %d", &options.height, "Window height in pixel", "--list-devices", &list, "List information about all available devices", +#ifdef WITH_CYCLES_LOGGING + "--debug", &debug, "Enable debug logging", + "--verbose %d", &verbosity, "Set verbosity of the logger", +#endif "--help", &help, "Print help message", NULL); @@ -355,7 +361,13 @@ static void options_parse(int argc, const char **argv) ap.usage(); exit(EXIT_FAILURE); } - else if(list) { + + if (debug) { + util_logging_start(); + util_logging_verbosity_set(verbosity); + } + + if(list) { vector<DeviceInfo>& devices = Device::available_devices(); printf("Devices:\n"); @@ -435,6 +447,7 @@ using namespace ccl; int main(int argc, const char **argv) { + util_logging_init(argv[0]); path_init(); options_parse(argc, argv); |