Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: MinGW compatible build. #562

Draft
wants to merge 79 commits into
base: master
Choose a base branch
from

Conversation

tupoy-ya
Copy link
Contributor

@tupoy-ya tupoy-ya commented Nov 9, 2022

Reason

MSVC is windows only and using a VM to compile this menu every time you change something isn't nice.

Related:

Additional context

  • Compiles on MinGW
  • Compiles on MSVC
  • Compiles on Clang with MSVC Headers
  • Compiles on Clang with MinGW Headers
  • Runs
  • CI
  • CI Clang
  • Fix virtual function crash (works in clang-cl)
  • Maybe make it link dynamically? (Partial only with clang-cl)
  • Set compiler, assembler, system_name automatically

This is what i do to compile it (copy-pasted from CI)

cmake -DCMAKE_BUILD_TYPE:STRING=Release -S. -Bbuild -DCROSSCOMPILE=ON -DUSE_GCC=ON -G Ninja

cmake --build build --config Release

P.s: Some commits from my cmake PR are visible here sorry about that.

chore(logger.cpp): Remove <format> include.
refactor(CMakeLists.txt): Tabs to spaces.
working-directory: build/Release/
chore(CMakeLists.txt): Remove "Disable warnings" (Needs test in CI).
refactor(CMakeLists.txt): Change "BigBaseV2" to "YimMenu".
chore: Remove g_is_steam check.
fix(CI): Fix CI trying to access `BigBaseV2.dll` instead of `YimMenu.dll`.
…to feat-cmake-build.

That was easier then i expected.
fix(MSVC): Added some `#if _MSVC_VER` checks.
…to feat-mingw-build.

The build will fail, just committing in case i will try to update it
again.
@tupoy-ya
Copy link
Contributor Author

I had to remove signature scanning from pointers.cpp because #1227 uses a C++ 20 extension that is not supported by anything except the MSVC compiler. Even Visual Studio doesn't support it.

Is there any other way to implement ptr cache?

@xiaoxiao921
Copy link
Member

Yes.

https://godbolt.org/z/5Kdesxfq3

chore(CI): A little more uniform CI.

Untested.
@github-actions
Copy link

github-actions bot commented Jun 17, 2023

Download the artifacts for this pull request:

tupoy-ya and others added 6 commits June 17, 2023 21:50
@xiaoxiao921
Copy link
Member

xiaoxiao921 commented Nov 30, 2023

What's the reason to not use

msvc-x64-cmake provided by the msvc-wine-git aur package and similar packages? I've had multiple people with Linux under arch systems and similar successfully compiling

@tupoy-ya
Copy link
Contributor Author

tupoy-ya commented Nov 30, 2023

What's the reason to not use

msvc-x64-cmake provided by the msvc-wine-git aur package and similar packages? I've had multiple people with Linux under arch systems and similar successfully compiling

I already use msvc-wine, but i want clangd language server and i don't want to run wine all the time.

Right now I'm using clang with msvc headers to compile YimMenu, and the main problem was pointers.cpp.
So I'm just waiting for support from clang, and while I'm waiting I might as well fix everything else, and use the temporary solution of removing the ptr cache.

Ah and also i think cpr did not work with msvc-wine some time ago, but maybe i did something wrong.
EDIT: Also also lua does not compile there after the ImGui bindings.

@xiaoxiao921
Copy link
Member

I see, you can fix up pointers.cpp by explicitly using a compile time string struct ( there is one in common.hpp) and not using inline struct declaration inside the template parameters or at least be explicit about the constructor should fix it. For Lua imgui bindings they work under msvc wine, unsure about the other compilers

fix(MinGW): Attent to fix MinGW not building.
MinGW fix is untested.
fix(MinGW): Fixed some mingw error, not that it will build lua without it.

Untested.
@Yimura Yimura mentioned this pull request Mar 6, 2024
2 tasks
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.

7 participants