cleaned and organized files
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -16,5 +16,5 @@ build/
|
|||||||
#Cleanup unused build files
|
#Cleanup unused build files
|
||||||
src/*obj
|
src/*obj
|
||||||
src/discord-game-sdk-cpp/*obj
|
src/discord-game-sdk-cpp/*obj
|
||||||
project/addons/discord-rpc-gd/bin/*exp
|
project/addons/discord-rpc-gd/bin/windows/*exp
|
||||||
project/addons/discord-rpc-gd/bin/*lib
|
project/addons/discord-rpc-gd/bin/windows/*lib
|
49
SConstruct
49
SConstruct
@@ -1,63 +1,40 @@
|
|||||||
#!python
|
#!python
|
||||||
import os
|
import os
|
||||||
|
|
||||||
opts = Variables([], ARGUMENTS)
|
|
||||||
|
|
||||||
# Gets the standard flags CC, CCX, etc.
|
# Gets the standard flags CC, CCX, etc.
|
||||||
env = SConscript("godot-cpp/SConstruct")
|
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 = "lib/discord-game-sdk"
|
|
||||||
|
|
||||||
# Updates the environment with the option variables.
|
|
||||||
opts.Update(env)
|
|
||||||
|
|
||||||
# For the reference:
|
|
||||||
# - CCFLAGS are compilation flags shared between C and C++
|
|
||||||
# - CFLAGS are for C-specific compilation flags
|
|
||||||
# - CXXFLAGS are for C++-specific compilation flags
|
|
||||||
# - CPPFLAGS are for pre-processor flags
|
|
||||||
# - CPPDEFINES are for pre-processor defines
|
|
||||||
# - LINKFLAGS are for linking flags
|
|
||||||
|
|
||||||
# Check our platform specifics
|
# Check our platform specifics
|
||||||
if env['platform'] == "macos":
|
if env['platform'] == "macos":
|
||||||
# Set the correct library
|
|
||||||
discord_library = 'discord_game_sdk.dylib'
|
discord_library = 'discord_game_sdk.dylib'
|
||||||
|
libexportfolder = "/macos/"
|
||||||
|
|
||||||
elif env['platform'] in ('linuxbsd', 'linux'):
|
elif env['platform'] in ('linuxbsd', 'linux'):
|
||||||
# Set correct library
|
|
||||||
discord_library = 'discord_game_sdk.so'
|
discord_library = 'discord_game_sdk.so'
|
||||||
|
libexportfolder = "/linux/"
|
||||||
|
|
||||||
elif env['platform'] == "windows":
|
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'
|
discord_library = 'discord_game_sdk.dll'
|
||||||
|
libexportfolder = "/windows/"
|
||||||
|
|
||||||
|
if env['target'] == "template_debug":
|
||||||
|
debugsuffix = "_debug"
|
||||||
|
else:
|
||||||
|
debugsuffix = ""
|
||||||
|
|
||||||
# make sure our binding library is properly includes
|
# make sure our binding library is properly includes
|
||||||
env.Append(LIBPATH=[discord_lib_path])
|
env.Append(LIBPATH=["lib/discord-game-sdk/"])
|
||||||
sources = Glob('src/discord-game-sdk-cpp/*.cpp')
|
sources = Glob('src/discord-game-sdk-cpp/*.cpp')
|
||||||
env.Append(CPPPATH=['src/discord-game-sdk-cpp'])
|
env.Append(CPPPATH=['src/discord-game-sdk-cpp'])
|
||||||
env.Append(LIBS=[
|
env.Append(LIBS=[discord_library.replace(".dll", "")])
|
||||||
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/'])
|
env.Append(CPPPATH=['src/'])
|
||||||
sources += Glob('src/*.cpp')
|
sources += Glob('src/*.cpp')
|
||||||
|
|
||||||
library = env.SharedLibrary(target="project/addons/discord-rpc-gd/bin/discordrpc" + env["suffix"] + env["SHLIBSUFFIX"], source=sources)
|
#The finished exports
|
||||||
env.Depends(library, Command("project/addons/discord-rpc-gd/bin/" + discord_library, discord_lib_path + "/" + discord_library, Copy("$TARGET", "$SOURCE")))
|
library = env.SharedLibrary(target="project/addons/discord-rpc-gd/bin/" + libexportfolder + "discord_game_sdk_binding" + debugsuffix, source=sources)
|
||||||
|
env.Depends(library, Command("project/addons/discord-rpc-gd/bin/" + libexportfolder + discord_library, "lib/discord-game-sdk/" + discord_library, Copy("$TARGET", "$SOURCE")))
|
||||||
|
|
||||||
Default(library)
|
Default(library)
|
||||||
|
|
||||||
# Generates help for the -h scons option.
|
|
||||||
Help(opts.GenerateHelpText(env))
|
|
Binary file not shown.
Binary file not shown.
@@ -4,38 +4,26 @@ entry_symbol = "discordrpcgd_library_init"
|
|||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
|
|
||||||
macos.debug = "bin/discordrpc.macos.template_debug.framework"
|
macos.debug = "bin/macos/discord_game_sdk_binding_debug.framework"
|
||||||
macos.release = "bin/discordrpc.macos.template_release.framework"
|
macos.release = "bin/macos/discord_game_sdk_binding.framework"
|
||||||
windows.debug.x86_32 = "bin/discordrpc.windows.template_debug.x86_32.dll"
|
windows.debug.x86_64 = "bin/windows/discord_game_sdk_binding_debug.dll"
|
||||||
windows.release.x86_32 = "bin/libgdexample.windows.template_release.x86_32.dll"
|
windows.release.x86_64 = "bin/windows/discord_game_sdk_binding.dll"
|
||||||
windows.debug.x86_64 = "bin/discordrpc.windows.template_debug.x86_64.dll"
|
linux.debug.x86_64 = "bin/linux/discord_game_sdk_binding_debug.so"
|
||||||
windows.release.x86_64 = "bin/discordrpc.windows.template_release.x86_64.dll"
|
linux.release.x86_64 = "bin/linux/discord_game_sdk_binding.so"
|
||||||
linux.debug.x86_64 = "bin/discordrpc.linux.template_debug.x86_64.so"
|
linux.debug.arm64 = "bin/linux/discord_game_sdk_binding_debug.so"
|
||||||
linux.release.x86_64 = "bin/discordrpc.linux.template_release.x86_64.so"
|
linux.release.arm64 = "bin/linux/discord_game_sdk_binding.so"
|
||||||
linux.debug.arm64 = "bin/discordrpc.linux.template_debug.arm64.so"
|
linux.debug.rv64 = "bin/linux/discord_game_sdk_binding_debug.so"
|
||||||
linux.release.arm64 = "bin/discordrpc.linux.template_release.arm64.so"
|
linux.release.rv64 = "bin/linux/discord_game_sdk_binding.so"
|
||||||
linux.debug.rv64 = "bin/discordrpc.linux.template_debug.rv64.so"
|
|
||||||
linux.release.rv64 = "bin/discordrpc.linux.template_release.rv64.so"
|
|
||||||
android.debug.x86_64 = "bin/discordrpc.android.template_debug.x86_64.so"
|
|
||||||
android.release.x86_64 = "bin/discordrpc.android.template_release.x86_64.so"
|
|
||||||
android.debug.arm64 = "bin/discordrpc.android.template_debug.arm64.so"
|
|
||||||
android.release.arm64 = "bin/discordrpc.android.template_release.arm64.so"
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
||||||
macos.debug = "bin/discord_game_sdk.framework"
|
macos.debug = "bin/macos/discord_game_sdk.framework"
|
||||||
macos.release = "bin/discord_game_sdk.framework"
|
macos.release = "bin/macos/discord_game_sdk.framework"
|
||||||
windows.debug.x86_32 = "bin/discord_game_sdk.dll"
|
windows.debug.x86_64 = "bin/windows/discord_game_sdk.dll"
|
||||||
windows.release.x86_32 = "bin/discord_game_sdk.dll"
|
windows.release.x86_64 = "bin/windows/discord_game_sdk.dll"
|
||||||
windows.debug.x86_64 = "bin/discord_game_sdk.dll"
|
linux.debug.x86_64 = "bin/linux/discord_game_sdk.so"
|
||||||
windows.release.x86_64 = "bin/discord_game_sdk.dll"
|
linux.release.x86_64 = "bin/linux/discord_game_sdk.so"
|
||||||
linux.debug.x86_64 = "bin/ldiscord_game_sdk.so"
|
linux.debug.arm64 = "bin/linux/discord_game_sdk.so"
|
||||||
linux.release.x86_64 = "bin/discord_game_sdk.so"
|
linux.release.arm64 = "bin/linux/discord_game_sdk.so"
|
||||||
linux.debug.arm64 = "bin/discord_game_sdk.so"
|
linux.debug.rv64 = "bin/linux/ldiscord_game_sdk.so"
|
||||||
linux.release.arm64 = "bin/discord_game_sdk.so"
|
linux.release.rv64 = "bin/linux/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"
|
|
Reference in New Issue
Block a user