still the same error but better written building script :/

This commit is contained in:
Yannik
2023-04-14 13:56:01 +02:00
parent 7ff7dd77d4
commit 4359bc1396
28 changed files with 71 additions and 129 deletions

View File

@@ -1,8 +1,20 @@
#!/usr/bin/env python #!python
import os import os
import sys
env = SConscript("./godot-cpp/SConstruct") opts = Variables([], ARGUMENTS)
# Gets the standard flags CC, CCX, etc.
env = SConscript("godot-cpp/SConstruct")
# Define our options
opts.Add(PathVariable('target_path', 'The path where the lib is installed.', 'project/addons/discord-rpc-gd/bin'))
opts.Add(PathVariable('target_name', 'The library name.', 'discord_game_sdk', PathVariable.PathAccept))
# Local dependency paths, adapt them to your setup
discord_lib_path = "project/addons/discord-rpc-gd/bin"
# Updates the environment with the option variables.
opts.Update(env)
# For the reference: # For the reference:
# - CCFLAGS are compilation flags shared between C and C++ # - CCFLAGS are compilation flags shared between C and C++
@@ -12,25 +24,38 @@ env = SConscript("./godot-cpp/SConstruct")
# - CPPDEFINES are for pre-processor defines # - CPPDEFINES are for pre-processor defines
# - LINKFLAGS are for linking flags # - LINKFLAGS are for linking flags
# Check our platform specifics
if env['platform'] == "macos":
# Set the correct library
discord_library = 'discord_game_sdk.dylib'
elif env['platform'] in ('linuxbsd', 'linux'):
# Set correct library
discord_library = 'discord_game_sdk.so'
elif env['platform'] == "windows":
# This makes sure to keep the session environment variables on windows,
# that way you can run scons in a vs 2017 prompt and it will find all the required tools
# env.Append(ENV=os.environ)
# Set correct library
discord_library = 'discord_game_sdk.dll'
# make sure our binding library is properly includes
env.Append(LIBPATH=[discord_lib_path])
env.Append(CPPPATH=['src\discord-game-sdk-cpp'])
env.Append(LIBS=[
discord_library.replace(".dll", "")
])
# tweak this if you want to use different folders, or more folders, to store your source code in. # tweak this if you want to use different folders, or more folders, to store your source code in.
env.Append(CPPPATH=['src/'])
sources = Glob('src/*.cpp')
env.Append(CPPPATH=["src/"]) library = env.SharedLibrary(target=env['target_path'] + env['target_name'] + env["suffix"] + env["SHLIBSUFFIX"], source=sources)
env.Append(LIBS=["discord_game_sdk"]) env.Depends(library, Command("project/addons/discord-rpc-gd/bin" + discord_library, discord_lib_path + "/" + discord_library, Copy("$TARGET", "$SOURCE")))
env.Append(LIBPATH=["project/addons/discord-rpc-gd/lib"])
sources = Glob("src/*.cpp")
if env["platform"] == "macos":
library = env.SharedLibrary(
"project/addons/discord-rpc-gd/bin/libgd-discordrpc.{}.{}.framework/discord-rpc-gd.{}.{}".format(
env["platform"], env["target"], env["platform"], env["target"]
),
source=sources,
)
else:
library = env.SharedLibrary(
"project/addons/discord-rpc-gd/bin/libgd-discordrpc{}{}".format(env["suffix"], env["SHLIBSUFFIX"]),
source=sources,
)
Default(library) Default(library)
# Generates help for the -h scons option.
Help(opts.GenerateHelpText(env))

View File

@@ -20,3 +20,22 @@ android.debug.x86_64 = "bin/libgd-discordrpc.android.template_debug.x86_64.so"
android.release.x86_64 = "bin/libgd-discordrpc.android.template_release.x86_64.so" android.release.x86_64 = "bin/libgd-discordrpc.android.template_release.x86_64.so"
android.debug.arm64 = "bin/libgd-discordrpc.android.template_debug.arm64.so" android.debug.arm64 = "bin/libgd-discordrpc.android.template_debug.arm64.so"
android.release.arm64 = "bin/libgd-discordrpc.android.template_release.arm64.so" android.release.arm64 = "bin/libgd-discordrpc.android.template_release.arm64.so"
[dependencies]
macos.debug = "bin/discord_game_sdk.framework"
macos.release = "bin/discord_game_sdk.framework"
windows.debug.x86_32 = "bin/discord_game_sdk.dll"
windows.release.x86_32 = "bin/discord_game_sdk.dll"
windows.debug.x86_64 = "bin/discord_game_sdk.dll"
windows.release.x86_64 = "bin/discord_game_sdk.dll"
linux.debug.x86_64 = "bin/ldiscord_game_sdk.so"
linux.release.x86_64 = "bin/discord_game_sdk.so"
linux.debug.arm64 = "bin/discord_game_sdk.so"
linux.release.arm64 = "bin/discord_game_sdk.so"
linux.debug.rv64 = "bin/discord_game_sdk.so"
linux.release.rv64 = "bin/discord_game_sdk.so"
android.debug.x86_64 = "bin/discord_game_sdk.so"
android.release.x86_64 = "bin/discord_game_sdk.so"
android.debug.arm64 = "bin/discord_game_sdk.so"
android.release.arm64 = "bin/discord_game_sdk.so"

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

View File

@@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cwwdhvaogsdtb"
path="res://.godot/imported/Banner_v1.png-5ed14d0906a04274d823c02cd90d1aad.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/Banner_v1.png"
dest_files=["res://.godot/imported/Banner_v1.png-5ed14d0906a04274d823c02cd90d1aad.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

View File

@@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d3prnkmtfx1nq"
path="res://.godot/imported/Logo_V2.png-3c17f898c9e359ffd20bde3cd3e1cd33.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/Logo_V2.png"
dest_files=["res://.godot/imported/Logo_V2.png-3c17f898c9e359ffd20bde3cd3e1cd33.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://vj51qej4ohom"
path="res://.godot/imported/Logo_V2_Clyde.png-2f34f333e2fac3b95f8c8c6a41e767f0.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/Logo_V2_Clyde.png"
dest_files=["res://.godot/imported/Logo_V2_Clyde.png-2f34f333e2fac3b95f8c8c6a41e767f0.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -4,9 +4,8 @@
#include "./discord-game-sdk-cpp/discord.h" #include "./discord-game-sdk-cpp/discord.h"
using namespace godot; using namespace godot;
using namespace discord;
Core *core{}; // discord::Core *core{};
void DiscordRPC::_bind_methods() void DiscordRPC::_bind_methods()
{ {
@@ -25,12 +24,13 @@ DiscordRPC::~DiscordRPC()
void DiscordRPC::_ready() void DiscordRPC::_ready()
{ {
/*discord::Result res = Core::Create(53908232506183680, DiscordCreateFlags_NoRequireDiscord, &core); /*auto result = discord::Core::Create(461618159171141643, DiscordCreateFlags_Default, &core);
Activity activity{}; discord::Activity activity{};
UtilityFunctions::print(core);
activity.SetState("Testing"); activity.SetState("Testing");
activity.SetDetails("Fruit Loops"); activity.SetDetails("Fruit Loops");
core->ActivityManager().UpdateActivity(activity, [](Result res) {});*/ core->ActivityManager().UpdateActivity(activity, [](discord::Result result) {
});*/
} }
void DiscordRPC::_process(float delta) void DiscordRPC::_process(float delta)

Binary file not shown.

Binary file not shown.