Skip to content

Make Windows (MinGW G++) compatible#445

Open
andrewxu319 wants to merge 11 commits into
developfrom
andrew/windows-compatibility
Open

Make Windows (MinGW G++) compatible#445
andrewxu319 wants to merge 11 commits into
developfrom
andrew/windows-compatibility

Conversation

@andrewxu319

Copy link
Copy Markdown
Collaborator

Description

Make compiler-specific changes such that GridKit runs and pass all tests on Windows. Specifically, it now works with MinGW G++, but not MSVC.

Please describe the issue that is addressed (bug, new feature,
documentation, enhancement, etc.). Please also include relevant motivation and
context. List any dependencies that are required for this change.

Closes #(issue)

Mentions @(user)

Proposed changes

Describe how your changes here address the issue and why the proposed changes
should be accepted.

  • Append .string() to .filename() to extract the underlying string if the OS is Windows
  • Replace __attribute__((always_inline)) inline with a compiler-specific FORCE_INLINE macro
  • Inline toUpper() to avoid compiler errors

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask. We're here
to help! This is simply a reminder of what we are going to look for before
merging your code.

  • All tests pass.
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows GridKit™ style guidelines.
  • There are unit tests for the new code.
  • The new code is documented.
  • The feature branch is rebased with respect to the target branch.
  • I have updated CHANGELOG.md to reflect the changes in this PR. If this is a minor PR that is part of a larger fix already included in the file, state so.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining
why you chose the solution you did and what alternatives you considered, etc...

@andrewxu319 andrewxu319 requested a review from pelesh June 10, 2026 13:41
Comment thread README.md Outdated
```powershell
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/path/to/install -DBUILD_SHARED_LIBS=OFF ../

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are different instructions really needed? The only difference I see with the earlier instructions is DBUILD_SHARED_LIBS=Off. I would recommend implementing a workaround for that in CMake instead.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Maybe not. Removed it for now. However I did also need to specify the directory ../ instead of ../GridKit.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

../GridKit is suggested for out-of-source builds, with the build and GridKit directories being at the same level in the file structure.

@nkoukpaizan

Copy link
Copy Markdown
Collaborator

re 5ffbf8d: I recommend rebasing (git rebase) rather than merging (git merge). That should fix most of the testing issues.

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