[PR #6] [MERGED] Statically link MinGW builds to eliminate DLL dependencies #19

Closed
opened 2026-03-03 12:01:45 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ForLoopCodes/legacy-notepad/pull/6
Author: @Copilot
Created: 1/30/2026
Status: Merged
Merged: 1/30/2026
Merged by: @ForLoopCodes

Base: mainHead: copilot/release-statically-linked-exe


📝 Commits (2)

  • 0061068 Initial plan
  • b7d6259 Fix MinGW DLL dependency by adding -static flag

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 CMakeLists.txt (+1 -1)

📄 Description

Releases built with MinGW depend on libwinpthread-1.dll and other runtime DLLs, requiring users to have MinGW installed.

Changes

  • Added -static flag to MinGW linker options in CMakeLists.txt

The existing -static-libgcc -static-libstdc++ flags only covered GCC/C++ runtimes. The -static flag ensures complete static linking including winpthread.

if(NOT MSVC)
    target_link_options(legacy-notepad PRIVATE -mwindows -municode -static)
    target_link_libraries(legacy-notepad PRIVATE -static-libgcc -static-libstdc++)
    # ...
endif()

Result: Standalone exe with no MinGW dependencies. MSVC builds unchanged.

Original prompt

This section details on the original issue you should resolve

<issue_title>The exe download from the release does not work without MinGW installed</issue_title>
<issue_description>The exe depends on some MinGW dll. Please release a statically linked exe.</issue_description>

Comments on the Issue (you are @copilot in this section)

@ForLoopCodes will fix! can you try out the old version though? does it work

Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ForLoopCodes/legacy-notepad/pull/6 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 1/30/2026 **Status:** ✅ Merged **Merged:** 1/30/2026 **Merged by:** [@ForLoopCodes](https://github.com/ForLoopCodes) **Base:** `main` ← **Head:** `copilot/release-statically-linked-exe` --- ### 📝 Commits (2) - [`0061068`](https://github.com/ForLoopCodes/legacy-notepad/commit/0061068542bd5c858549112898b4dd27b56d9fa5) Initial plan - [`b7d6259`](https://github.com/ForLoopCodes/legacy-notepad/commit/b7d6259d25afce01b2fd39ebe622baa21c8f3e60) Fix MinGW DLL dependency by adding -static flag ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+1 -1) </details> ### 📄 Description Releases built with MinGW depend on `libwinpthread-1.dll` and other runtime DLLs, requiring users to have MinGW installed. ## Changes - Added `-static` flag to MinGW linker options in CMakeLists.txt The existing `-static-libgcc -static-libstdc++` flags only covered GCC/C++ runtimes. The `-static` flag ensures complete static linking including winpthread. ```cmake if(NOT MSVC) target_link_options(legacy-notepad PRIVATE -mwindows -municode -static) target_link_libraries(legacy-notepad PRIVATE -static-libgcc -static-libstdc++) # ... endif() ``` Result: Standalone exe with no MinGW dependencies. MSVC builds unchanged. <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>The exe download from the release does not work without MinGW installed</issue_title> > <issue_description>The exe depends on some MinGW dll. Please release a statically linked exe.</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > <comment_new><author>@ForLoopCodes</author><body> > will fix! can you try out the old version though? does it work</body></comment_new> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes ForLoopCodes/legacy-notepad#5 <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/ForLoopCodes/legacy-notepad/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 12:01:45 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/legacy-notepad#19
No description provided.