An option to allow linking the MSVC runtime library statically#2420
An option to allow linking the MSVC runtime library statically#2420apwojcik wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Verdict: APPROVE -- submitted as COMMENT (automated reviews are advisory) · Findings: 0 (0 Critical, 0 Major, 0 Minor)
Scope
Adds a Windows-only CMake option ROCMLIR_USE_MSVC_STATIC_RUNTIME (default OFF) that selects between static and dynamic linkage of the MSVC runtime library via CMAKE_MSVC_RUNTIME_LIBRARY. Single-file change to CMakeLists.txt.
Findings
No blocking issues found. The generator-expression logic is correct: with the option OFF the suffix DLL yields MultiThreaded[Debug]DLL (dynamic, preserving prior default behavior); with it ON the suffix is empty, yielding MultiThreaded[Debug] (static). The if(NOT CMAKE_MSVC_RUNTIME_LIBRARY) guard correctly defers to a user-supplied value.
Notes
CMAKE_MSVC_RUNTIME_LIBRARYis only honored when policyCMP0091isNEW. This is the default here because the top-levelcmake_minimum_required(VERSION 3.15.1)is >= 3.15, so no explicitcmake_policy(SET CMP0091 NEW)is required. Worth being aware of if a subproject ever lowers the effective policy scope, but that is not a concern for this diff.- The change is scoped inside the
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")block, so it has no effect on Linux builds.
CI status
Several Jenkins/internal checks (Build and Test, Parameter sweeps, MIGraphX, ml-ci-internal.amd.com, etc.) report ERROR/FAILURE. These run on Linux and are unaffected by a Windows-only CMake option; the failures appear to be infrastructure-related rather than caused by this change. The relevant C/C++ premerge checks and Python format and lint checks pass. Maintainers should confirm the Jenkins errors are pre-existing/infra noise before merge.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2420 +/- ##
===========================================
+ Coverage 82.57% 82.70% +0.14%
===========================================
Files 120 120
Lines 42852 42828 -24
Branches 7110 7106 -4
===========================================
+ Hits 35381 35419 +38
+ Misses 4815 4788 -27
+ Partials 2656 2621 -35
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
The PR adds a CMake option to control whether the MSVC runtime library is dynamically or statically linked.