Skip to content

Comments

Disable DEBUG defines by default#687

Merged
monkeyman192 merged 1 commit intomonkeyman192:developmentfrom
GreemDev:development
Feb 20, 2026
Merged

Disable DEBUG defines by default#687
monkeyman192 merged 1 commit intomonkeyman192:developmentfrom
GreemDev:development

Conversation

@GreemDev
Copy link

@GreemDev GreemDev commented Feb 20, 2026

Currently working on a project (which will be open source when it is ready), and I have a submodule of MBINCompiler in my project specifically referencing the source files for libMBIN, to form my own in-project libMBIN. I did this to avoid DLL loading headaches; effectively "statically linking" libMBIN instead of dynamically.

This works wonderfully, except it's painfully slow due to the debug logs and I can't seem to be able to remove them without direct source modifications, or some MSBuild shenanigans I'm frankly terrified by.

For now I just excluded the specific file:

        <Compile Include="..\..\3rdparty\MBINCompiler\libMBIN\Source\**\*.cs" LinkBase="DoNotModify-3rdparty"/>
+       <!-- Has unremovable debug defines, so we copy this file into our source manually with those removed. -->
+       <Compile Remove="..\..\3rdparty\MBINCompiler\libMBIN\Source\Template\NMSTemplate.cs"/>

and included the file unmodified in my own libMBIN project directory, with the defines removed entirely. This fixes the issue.

Alternatively this PR fixes the issue, for me in the future and anyone who uses this source code without expecting those defines to be there, such as myself.

Thanks for the work on this project!

@monkeyman192
Copy link
Owner

Sorry about this! I accidentally left these in while I was testing something. They shouldn't be enabled.
Thanks for fixing this

@monkeyman192 monkeyman192 merged commit 93cc28f into monkeyman192:development Feb 20, 2026
6 checks passed
@monkeyman192
Copy link
Owner

Also, regarding "statically" linking libMBIN, I'd caution against doing this as it would mean that every time MBINCompiler is updated, you'd need to build and release your tool as well. This does happen with another tool (https://github.com/cmkushnir/NMSModBuilder), but if it is possible, having it dynamically linked might save you some headaches depending on what you are doing.
It just means that you can always just drop in the latest dll and have it run, rather than needing to push a new version.
But obviously up to you. NMS does get fairly regular updates, so just some pros and cons to weigh up 😄

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