simongeilfus / Cinder-Runtime

Runtime-Compiled C++ for Cinder
57 stars 43 forks source link

debugging printToString() methods, called when verbose() is on #8

Closed richardeakin closed 7 years ago

richardeakin commented 7 years ago

Added some debug printToString() methods that will make it easy to dump current configurations to a log to help facilitate tracking stuff down. For now I'm just adjusting the RT_VERBOSE_DEFAULT flag at the top of CompilerMSVC as the BuildSettings are constructed from the stuff inside the magic new macros. Hopefully later on we'll have an easy way to set that at runtime from the outside but this is working now I think for basic debugging.

It's pretty verbose, we do levels, though it seems like for debugging purposes a lot of this can be useful. one thing I'm noticing is that the BuildSettings structure gets called 3 or 4 times at startup, and as I'm logging from there you get this dump each time. I imagine we can reduce that.

Output currently ends up looking like (for me, on the project I'm debugging):

|info   | runtime::CompilerMsvc::BuildSettings::BuildSettings[277] ProjectConfiguration: projectPath: D:\code\rte\mawork\test\Grapher\proj\vc2015\Grapher.vcxproj
    - configuration: Debug_Shared, platform: x64, platformTarget: x64, platformToolset: v140
|info   | runtime::CompilerMsvc::BuildSettings::BuildSettings[278] BuildSettings: link app objs: 1, generate factory: 1, generate pch: 0, use pch: 1
precompiled header: 
output path: 
intermediate path: D:\code\rte\mawork\test\Grapher\proj\vc2015\build\x64\Debug_Shared\v140\intermediate
pdb path: 
module name: 
includes:
    - D:\code\rte\mawork\test\Grapher\proj\vc2015\..\..\blocks\Cinder-Runtime\include
    - ..\src
    - $(REPO_PATH)\src
    - $(REPO_PATH)\lib\SpacePartitioning\include
    - $(REPO_PATH)\blocks\Cinder-Runtime\include
    - $(REPO_PATH)\blocks\mason\src
    - $(REPO_PATH)\blocks\mason\blocks\Cinder-View\src
    - $(REPO_PATH)\blocks\mason\blocks\Cinder-Profiler\src
    - $(CINDER_PATH)\include
library paths:
    - $(CINDER_PATH)\lib\msw\x64
    - $(CINDER_PATH)\lib\msw\x64\Debug_Shared\v140
libraries:
    - cinder.lib
    - OpenGL32.lib
    - $(REPO_PATH)\blocks\mason\lib\msw\$(PlatformTarget)\$(Configuration)\$(PlatformToolset)\mason.lib
    - $(REPO_PATH)\lib\msw\$(PlatformTarget)\$(Configuration)\$(PlatformToolset)\mawork.lib
additional sources:
forced includes:
preprocessor definitions: _DEBUG RT_COMPILED CINDER_SHARED WIN32 _WIN32_WINNT=0x0601 _WINDOWS NOMINMAX _DEBUG 
compiler options: /nologo /W3 /WX- /EHsc /RTC1 /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Gd /TP /Od /Zi /MDd 
linker options: /NOLOGO /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:LIBCPMT