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

add makefile steps to build a universal binary of the library #45

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

jamespanic
Copy link
Contributor

Should fix #39

@jamespanic jamespanic mentioned this pull request Aug 1, 2024
Copy link
Collaborator

@yancouto yancouto left a comment

Choose a reason for hiding this comment

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

This looks good, but I can't test right now because I don't have a Mac and Travis is no longer free.

I'm hoping you tested this in your machine.

@@ -23,7 +23,9 @@ all:
STEAM_LIB=sdk/redistributable_bin

osx:
$(CXX) $(SRC) $(CPP_FLAGS) ${STEAM_LIB}/osx/libsteam_api.dylib ${THIRD_PARTY}/lib/libluajit-5.1.a -o $(OSX_OUT) -shared -fPIC $(OSX_FLAGS)
$(CXX) $(SRC) $(CPP_FLAGS) -arch arm64 ${STEAM_LIB}/osx/libsteam_api.dylib ${THIRD_PARTY}/lib/libluajit-5.1.a -o $(OSX_OUT).arm64 -shared -fPIC $(OSX_FLAGS)
$(CXX) $(SRC) $(CPP_FLAGS) -arch x86_64 ${STEAM_LIB}/osx/libsteam_api.dylib ${THIRD_PARTY}/lib/libluajit-5.1.a -o $(OSX_OUT).x86_64 -shared -fPIC $(OSX_FLAGS)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice, it can all run in one machine, I thought it would need two.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's correct intel and arm macs can cross-compile to both archs.

@yancouto yancouto merged commit a65af71 into uspgamedev:master Aug 2, 2024
@jamespanic
Copy link
Contributor Author

This looks good, but I can't test right now because I don't have a Mac and Travis is no longer free.

I'm hoping you tested this in your machine.

Yes this has been tested and well be going into a shipping game.

@yancouto
Copy link
Collaborator

yancouto commented Aug 2, 2024

Thank you! I merged this for whoever wants to build, but I can't provide the auto-built universal libraries anymore because Travis is no longer free. (#46)

@yancouto
Copy link
Collaborator

yancouto commented Aug 2, 2024

Actually I managed to get free credits in Travis and fix the build (it was broken due to old XCode...)

If you have any free time, I would appreciate if you could quickly check if the CI-built universal library works: https://github.com/uspgamedev/luasteam/releases/tag/v3.2.1

@jamespanic
Copy link
Contributor Author

> lipo -archs osx_luasteam.so
x86_64 arm64

looks good!

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.

Apple Silicon Support
2 participants