Skip to content

Add dynamic debugging support for MSC (VS, Ninja)#2626

Merged
samsinsane merged 1 commit intopremake:masterfrom
nickclark2016:msc-dynamic-deopt
Feb 24, 2026
Merged

Add dynamic debugging support for MSC (VS, Ninja)#2626
samsinsane merged 1 commit intopremake:masterfrom
nickclark2016:msc-dynamic-deopt

Conversation

@nickclark2016
Copy link
Member

What does this PR do?

Adds support for Dynamic Debugging (/dynamicdeopt) for Visual Studio and MSC via Ninja.

How does this PR change Premake's behavior?

No breaking changes. Adds new API.

Anything else we should know?

Context: https://devblogs.microsoft.com/cppblog/cpp-dynamic-debugging-full-debuggability-for-optimized-builds/

Did you check all the boxes?

  • Focus on a single fix or feature; remove any unrelated formatting or code changes
  • Add unit tests showing fix or feature works; all tests pass
  • Mention any related issues (put closes #XXXX in comment to auto-close issue when PR is merged)
  • Follow our coding conventions
  • Minimize the number of commits
  • Align documentation to your changes

You can now support Premake on our OpenCollective. Your contributions help us spend more time responding to requests like these!

@nickclark2016 nickclark2016 requested a review from a team February 24, 2026 03:45
@samsinsane samsinsane merged commit 874699e into premake:master Feb 24, 2026
55 checks passed

### Availability ###

Premake 5.0.0 or later for Visual Studio 2022 and later or MSC toolsets.
Copy link
Contributor

Choose a reason for hiding this comment

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

Not beta9?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope. Next release is full release.

| Value | Description | Notes |
|-------|-------------|-------|
| Default | Uses the default dynamic debugging behavior. | |
| On | Allows dynamic debugging of source code. | For MSVC, debug [symbols](symbols.md) must be present. [Edit and Continue](editandcontinue.md) is not allowed. For a full list of flags that are required, see the [Microsoft Docs](https://learn.microsoft.com/en-us/cpp/build/reference/dynamic-deopt?view=msvc-170). |
Copy link
Contributor

Choose a reason for hiding this comment

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

Does msvc warn for incompatible flags?
Else we should probably emit a warning.

Copy link
Member Author

Choose a reason for hiding this comment

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

It errors, I believe. That said, this would break paradigm. We don't do that anywhere else.

dynamicdebugging "Off"
prepare()
test.excludes("/dynamicdeopt", msc.getcxxflags(cfg))
end
Copy link
Contributor

Choose a reason for hiding this comment

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

No tests for "Default"?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm torn on this, personally. I typically treat default as "do whatever the default for the toolset/exporter is" -- So nothing should be emitted at all. We could test that we don't put /dynamicdeopt in there, but we don't typically test the "default" case (though the argument could be made that we should)

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.

3 participants