Skip to content

An option to allow linking the MSVC runtime library statically#2420

Open
apwojcik wants to merge 1 commit into
developfrom
msvc_static_runtime
Open

An option to allow linking the MSVC runtime library statically#2420
apwojcik wants to merge 1 commit into
developfrom
msvc_static_runtime

Conversation

@apwojcik

Copy link
Copy Markdown
Contributor

The PR adds a CMake option to control whether the MSVC runtime library is dynamically or statically linked.

@apwojcik apwojcik requested a review from causten as a code owner June 30, 2026 13:10
@apwojcik apwojcik changed the title Link statically the MSVC runtime library An option to allow linking the MSVC runtime library statically Jun 30, 2026
@umangyadav umangyadav added the claude-review Trigger automated PR review by claude[bot]; auto-removed after the run. label Jul 3, 2026

@rocmlir-pr-reviewer rocmlir-pr-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_LIBRARY is only honored when policy CMP0091 is NEW. This is the default here because the top-level cmake_minimum_required(VERSION 3.15.1) is >= 3.15, so no explicit cmake_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.

@rocmlir-pr-reviewer rocmlir-pr-reviewer Bot removed the claude-review Trigger automated PR review by claude[bot]; auto-removed after the run. label Jul 3, 2026
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

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     
Flag Coverage Δ
gfx120x 82.57% <ø> (+0.04%) ⬆️
gfx950 82.57% <ø> (+0.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants