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

chore: add xmake build support #35

Merged
merged 3 commits into from
Sep 13, 2023

Conversation

qudix
Copy link
Contributor

@qudix qudix commented Sep 13, 2023

Builds with msvc-cl, xmake does not currently support toolchain switching for packages on windows, so clang-cl is off the table for now.

How to build using xmake:

xmake build

This will fetch the project's package dependencies if they aren't already installed, and build all default targets. Packages aren't version pinned at the moment, this can be changed later if necessary.

As for options, there is one at the moment, sfse_xbyak which you can enable using:

xmake config --sfse_xbyak=true

If a VS project is desired, one can be generated for you:

xmake project -k vsxmake

The project kind vsxmake still uses xmake as the backend for building and such while allowing you to use the VS editor.

@gottyduke
Copy link
Contributor

gottyduke commented Sep 13, 2023

Thank you, this is great addition, msvc-cl is good enough. Currently the CommonLibSF doesn't honor SFSE_SUPPORT_XBYAK option anymore, it will always use that dependency and link it (I have checked most of the past CLib-related projects, none of them explicitly turned off that option).

Do you also plan on making an xmake plugin template after this? We can put all community template links on the README for people to choose from.

@qudix
Copy link
Contributor Author

qudix commented Sep 13, 2023

I don't think it's a good idea to remove that option because otherwise consumers will be saddled with another dependency they don't even use. Not all (xSE) plugins do hooking, even fewer of those use xbyak. I checked and all the other CommonLib's do default to OFF.

As for a plugin template, there needs to be a package for commonlibsf to pull from, which means making a custom xmake-repo registry.

@gottyduke
Copy link
Contributor

Could you clarify the /utf-8 flag for me? I actually find another issue in xmake repo xmake-io/xmake-repo#2481 that's related to the fmtlib/fmt#3598

@qudix
Copy link
Contributor Author

qudix commented Sep 13, 2023

It sets the source (.cpp) and execution character set. I can add it if necessary. Did you run into an compilation error?

@gottyduke
Copy link
Contributor

gottyduke commented Sep 13, 2023

Did you run into an compilation error?

I did not have this error in xmake yet, but I did encounter the exact compilation error as fmtlib/fmt#3598 days ago in cmake-msvc setup, this was before I manually specified /utf-8 for all the projects, which has been working fine before the recent fmt 10.1 update.

I believe once fmt vcpkg port update their version to the latest with these PR fixes, this specific issue should not be present, but they haven't yet. Thank you for the fixes! Feel free to hit the merge button whenever your side of work is done and ready.

Edit for clarity:
I plan on adding the SFSE_SUPPORT_XBYAK option back, so nothing needs to change on your side.

@qudix qudix merged commit 58e0a50 into Starfield-Reverse-Engineering:main Sep 13, 2023
3 checks passed
gottyduke added a commit that referenced this pull request Sep 13, 2023
+ Added various template links for people to choose from(vcpkg port, git
submodule and xmake templates).
+ Added xmake package consume instruction.

This complements #35 .
@qudix qudix deleted the dev/xmake branch October 14, 2023 16:48
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