Skip to content

Default MSVC static CRT for static yaml-cpp builds - #1484

Draft
harleywilsoneng wants to merge 6 commits into
jbeder:masterfrom
harleywilsoneng:fix/msvc-static-crt-1354
Draft

Default MSVC static CRT for static yaml-cpp builds#1484
harleywilsoneng wants to merge 6 commits into
jbeder:masterfrom
harleywilsoneng:fix/msvc-static-crt-1354

Conversation

@harleywilsoneng

Copy link
Copy Markdown
Contributor

Fixes #1354

Summary

  • Default YAML_MSVC_SHARED_RT to ${YAML_BUILD_SHARED_LIBS} so static yaml-cpp builds use /MT by default on MSVC.
  • Document static CRT behavior and YAML_CPP_STATIC_DEFINE for consumers linking the static library.

Test plan

  • Configure a static MSVC build and verify /MT is selected by default.
  • Configure with -DYAML_MSVC_SHARED_RT=ON and verify /MD is still available.

Signed-off-by: harleywilsoneng <harleywilsoneng@users.noreply.github.com>
Signed-off-by: harleywilsoneng <harleywilsoneng@users.noreply.github.com>
Signed-off-by: harleywilsoneng <harleywilsoneng@users.noreply.github.com>
Signed-off-by: harleywilsoneng <harleywilsoneng@users.noreply.github.com>
Signed-off-by: harleywilsoneng <harleywilsoneng@users.noreply.github.com>
Signed-off-by: harleywilsoneng <harleywilsoneng@users.noreply.github.com>
@SGSSGene

Copy link
Copy Markdown
Collaborator

Amazing! This is highly appreciated!

I took the liberty to convert it to a "draft" PR. Please convert it back to a normal PR when it is ready to be reviewed.

@SGSSGene
SGSSGene marked this pull request as draft August 13, 2026 04:59
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.

MSVC 2022 Static Linking Problem

2 participants