Skip to content

build: added MSVC target link for RelWithDebInfo#2071

Merged
alandtse merged 1 commit into
community-shaders:devfrom
davo0411:relwithdebinfo-fix
Apr 7, 2026
Merged

build: added MSVC target link for RelWithDebInfo#2071
alandtse merged 1 commit into
community-shaders:devfrom
davo0411:relwithdebinfo-fix

Conversation

@davo0411
Copy link
Copy Markdown
Collaborator

@davo0411 davo0411 commented Apr 7, 2026

fix build failure with --config RelWithDebInfo

error:
ffx_backend_dx11_x64.lib(ffx_dx11.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification [F:\Community-Shaders-Working-Folder\Github-Fork\skyrim-community-shaders\build\ALL\CommunityShaders.vcxproj]
LINK : error LNK1218: warning treated as error; no output file generated [F:\Community-Shaders-Working-Folder\Github-Fork\skyrim-community-shaders\build\ALL\CommunityShaders.vcxproj]

Summary by CodeRabbit

  • Chores
    • Optimized MSVC build configuration for Release builds with debug information, enabling link-time code generation and removing incremental linking to improve build efficiency and binary optimization.

Copilot AI review requested due to automatic review settings April 7, 2026 09:51
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 7, 2026

📝 Walkthrough

Walkthrough

The CMakeLists.txt file has been updated to apply MSVC-specific linker optimizations for the RelWithDebInfo build configuration, adding /LTCG (Link Time Code Generation) and /INCREMENTAL:NO flags to the main target.

Changes

Cohort / File(s) Summary
MSVC Build Configuration
CMakeLists.txt
Added conditional linker flags for RelWithDebInfo configuration on MSVC: enables /LTCG for link-time code generation and disables incremental linking with /INCREMENTAL:NO.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • alandtse
  • doodlum

Poem

🐰 With whiskers twitched and paws in air,
Link-time code gen, oh what a pair!
LTCG blooms in debug's delight,
No incremental hops—optimization's tight!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately describes the main change: adding MSVC target link configuration for RelWithDebInfo builds to fix a linker issue.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

No actionable suggestions for changed features.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes an MSVC build failure for the RelWithDebInfo configuration by aligning linker settings with third-party libraries built with /GL (e.g., FidelityFX backend), preventing /LTCG-related warnings from being treated as errors.

Changes:

  • Add MSVC-only RelWithDebInfo linker flags to enable /LTCG.
  • Disable incremental linking (/INCREMENTAL:NO) for RelWithDebInfo to avoid LNK4075 and subsequent LNK1218 when /WX is enabled.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
CMakeLists.txt (2)

132-139: Consider centralizing this config in cmake/XSEPlugin.cmake.

MSVC compile/link profile rules are already managed there; moving this RelWithDebInfo policy there would reduce flag drift across files.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CMakeLists.txt` around lines 132 - 139, Move the MSVC-specific RelWithDebInfo
link options out of the top-level CMakeLists and into the central
cmake/XSEPlugin.cmake so flags stay consistent: remove the MSVC conditional
block that calls target_link_options(${PROJECT_NAME} PRIVATE
"$<$<CONFIG:RelWithDebInfo>:/LTCG>"
"$<$<CONFIG:RelWithDebInfo>:/INCREMENTAL:NO>") from this file and instead add
equivalent logic in cmake/XSEPlugin.cmake (guarded by MSVC and applying the
"$<$<CONFIG:RelWithDebInfo>:...>" generator expressions) so projects using
XSEPlugin automatically get the /LTCG and /INCREMENTAL:NO RelWithDebInfo
settings.

130-132: PR metadata follow-up: tighten title and add issue keyword.

Suggested title: fix(build): add msvc relwithdebinfo link flags
If this fixes a tracked bug, add Closes #<issue-id> (or Fixes #<issue-id>) in the PR description.

As per coding guidelines, provide suggestions for Conventional Commit Titles (type(scope): description, lowercase, 50-char title limit) and Issue References (Fixes #123 / `Closes `#123).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CMakeLists.txt` around lines 130 - 132, Update the PR title to the suggested
conventional-commit style "fix(build): add msvc relwithdebinfo link flags" and
add an issue reference line like "Fixes #<issue-id>" or "Closes #<issue-id>" to
the PR description; ensure the commit/PR title follows type(scope): description
lowercase and stays under ~50 characters, and mention the change in the PR body
referencing the MSVC-specific block (if(MSVC)) so reviewers know this targets
RelWithDebInfo linker flags.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@CMakeLists.txt`:
- Around line 132-139: Move the MSVC-specific RelWithDebInfo link options out of
the top-level CMakeLists and into the central cmake/XSEPlugin.cmake so flags
stay consistent: remove the MSVC conditional block that calls
target_link_options(${PROJECT_NAME} PRIVATE "$<$<CONFIG:RelWithDebInfo>:/LTCG>"
"$<$<CONFIG:RelWithDebInfo>:/INCREMENTAL:NO>") from this file and instead add
equivalent logic in cmake/XSEPlugin.cmake (guarded by MSVC and applying the
"$<$<CONFIG:RelWithDebInfo>:...>" generator expressions) so projects using
XSEPlugin automatically get the /LTCG and /INCREMENTAL:NO RelWithDebInfo
settings.
- Around line 130-132: Update the PR title to the suggested conventional-commit
style "fix(build): add msvc relwithdebinfo link flags" and add an issue
reference line like "Fixes #<issue-id>" or "Closes #<issue-id>" to the PR
description; ensure the commit/PR title follows type(scope): description
lowercase and stays under ~50 characters, and mention the change in the PR body
referencing the MSVC-specific block (if(MSVC)) so reviewers know this targets
RelWithDebInfo linker flags.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 370c2a2d-a7ba-4fcb-ab9e-eb8498fca621

📥 Commits

Reviewing files that changed from the base of the PR and between b4abab7 and 2ed1245.

📒 Files selected for processing (1)
  • CMakeLists.txt

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

✅ A pre-release build is available for this PR:
Download

@alandtse alandtse changed the title fix(build): added MSVC target link for RelWithDebInfo build: added MSVC target link for RelWithDebInfo Apr 7, 2026
@alandtse
Copy link
Copy Markdown
Collaborator

alandtse commented Apr 7, 2026

This is not user facing. It's not a fix.

@alandtse alandtse merged commit 26471ae into community-shaders:dev Apr 7, 2026
22 of 23 checks passed
ParticleTroned pushed a commit to ParticleTroned/skyrim-community-shaders that referenced this pull request May 2, 2026
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.

4 participants