crystal
crystal copied to clipboard
Linking against the debug MSVC runtime libraries
Currently, the Crystal runtime links against msvcrt
/ ucrt
/ vcruntime
for dynamic builds on Windows, and libcmt
/ libucrt
/ libvcruntime
for static builds. It would be great if Crystal could also link against the debug versions of those libraries, the ones with an extra d
at the end of their names, corresponding to the /MTd
and /MDd
VC++ compiler flags. (Actually, llvm_ext.cc
already uses this.) This would turn on assertions and allow the user to attach a debugger in case of an assertion failure:
LibC._close(-1)
Note however that these debug builds are not redistributable, so combining this feature into --debug
might not be the best idea, and instead we should spare a new flag like -Dmsvc_debug
.