Closed hcho3 closed 4 months ago
On the Windows platform, the MSVC (Microsoft Visual C++) runtime can be linked either statically or dynamically. Currently, DMLC-Core makes this choice by manually editing raw build flags:
https://github.com/dmlc/dmlc-core/blob/1ef66490be31c5c6d76eb3ec7593b010f25fc7f5/CMakeLists.txt#L200-L211
This approach is brittle and prone to errors.
A more robust method is to use the built-in flag CMAKE_MSVC_RUNTIME_LIBRARY to control the linking mode for the MSVC runtime.
CMAKE_MSVC_RUNTIME_LIBRARY
On the Windows platform, the MSVC (Microsoft Visual C++) runtime can be linked either statically or dynamically. Currently, DMLC-Core makes this choice by manually editing raw build flags:
https://github.com/dmlc/dmlc-core/blob/1ef66490be31c5c6d76eb3ec7593b010f25fc7f5/CMakeLists.txt#L200-L211
This approach is brittle and prone to errors.
A more robust method is to use the built-in flag
CMAKE_MSVC_RUNTIME_LIBRARY
to control the linking mode for the MSVC runtime.