LennyPhoenix / GodotDiscordSDK

A Discord Game SDK wrapper for Godot, written in C.
MIT License
54 stars 5 forks source link

Can't compile for any OS other than my own #16

Closed Lilith-In-Starlight closed 2 years ago

Lilith-In-Starlight commented 2 years ago

System Info

Describe the bug

The command manages to run for a while, giving a bunch of warnings: (osx example)

cl : Command line warning D9002 : ignoring unknown option '-g'
cl : Command line warning D9002 : ignoring unknown option '-O3'
cl : Command line warning D9002 : ignoring unknown option '-arch'
cl : Command line warning D9024 : unrecognized source file type 'x86_64', object file assumed
cl : Command line warning D9027 : source file 'x86_64' ignored

At some point it fails with

link /nologo -arch x86_64 /dll /out:demo\bin\osx-64\libgdsdk.dll /implib:demo\bin\osx-64\libgdsdk.lib /LIBPATH:lib discord_game_sdk.lib src\activities.obj src\core.obj src\discord.obj src\images.obj src\networking.obj src\relationships.obj src\users.obj src\util.obj src\activities\activity.obj src\activities\activity_assets.obj src\activities\activity_party.obj src\activities\activity_secrets.obj src\activities\activity_timestamps.obj src\activities\party_size.obj src\images\image_dimensions.obj src\images\image_handle.obj src\relationships\presence.obj src\relationships\relationship.obj src\users\user.obj
LINK : warning LNK4044: unrecognized option '/arch'; ignored
LINK : fatal error LNK1181: cannot open input file 'x86_64.obj'
scons: *** [demo\bin\osx-64\libgdsdk.dll] Error 1181
scons: building terminated because of errors.

To Reproduce

Use a platform other than the one you're building from in the scons command

Expected behaviour

It should compile binaries for the desired platform

Context

I normally dont build things myself, but the github actions artifacts have expired, so I had to do this, and I keep running into issues

Checklist

LennyPhoenix commented 2 years ago

Cross compilation is not supported, I would recommend using the GitHub artefacts for releasing on other platforms.

LennyPhoenix commented 2 years ago

I will rerun the GitHub actions build then make a release so they don't expire.

Lilith-In-Starlight commented 2 years ago

Oh that was a quick response, thanks!!!

Another question before closing this issue, will you port this to GDExtension once it replaces GDNative?

LennyPhoenix commented 2 years ago

I will certainly try, however this project is due a rewrite anyway. I'm not sure how long that will take but once GDExtension is stable I'll start experimenting. (Thinking of maybe using C++ next time, should get around some headaches I've experienced)

LennyPhoenix commented 2 years ago

Here is the release with all the artefacts: https://github.com/LennyPhoenix/GodotDiscordSDK/releases/tag/gdnative-final Hope this helps :)