diff --git a/.gitignore b/.gitignore index 3a0c8b0c..a2715452 100644 --- a/.gitignore +++ b/.gitignore @@ -79,6 +79,7 @@ sm64config.txt !/assets/**/*custom*.bin !/assets/**/*custom*/**/*.bin !/lib/discordsdk/*.* +!/lib/discordsdk/x86/*.* # visual studio build-windows-visual-studio/.vs diff --git a/Makefile b/Makefile index 4cd3a0f8..74008f71 100644 --- a/Makefile +++ b/Makefile @@ -118,6 +118,21 @@ ifneq ($(TARGET_BITS),0) BITS := -m$(TARGET_BITS) endif +# Determine default windows target bits + +ifeq ($(WINDOWS_BUILD), 1) + ifeq ($(TARGET_BITS), 0) + CPU_TYPE := $(firstword $(subst -, ,$(shell $(CC) -dumpmachine))) + ifeq ($(CPU_TYPE), x86_64) + TARGET_BITS := 64 + else ifeq ($(CPU_TYPE), i686) + TARGET_BITS := 32 + else ifeq ($(CPU_TYPE), mingw32) + TARGET_BITS := 32 + endif + endif +endif + # Release (version) flag defs ifeq ($(VERSION),jp) @@ -435,7 +450,11 @@ RPC_LIBS := DISCORD_SDK_LIBS := ifeq ($(DISCORD_SDK), 1) ifeq ($(WINDOWS_BUILD),1) - DISCORD_SDK_LIBS := lib/discordsdk/discord_game_sdk.dll + ifeq ($(TARGET_BITS), 32) + DISCORD_SDK_LIBS := lib/discordsdk/x86/discord_game_sdk.dll + else + DISCORD_SDK_LIBS := lib/discordsdk/discord_game_sdk.dll + endif else ifeq ($(OSX_BUILD),1) # needs testing DISCORD_SDK_LIBS := lib/discordsdk/discord_game_sdk.dylib diff --git a/lib/discordsdk/x86/discord_game_sdk.dll b/lib/discordsdk/x86/discord_game_sdk.dll new file mode 100644 index 00000000..8f1ee0a6 Binary files /dev/null and b/lib/discordsdk/x86/discord_game_sdk.dll differ diff --git a/lib/discordsdk/x86/discord_game_sdk.dll.lib b/lib/discordsdk/x86/discord_game_sdk.dll.lib new file mode 100644 index 00000000..58ec2820 Binary files /dev/null and b/lib/discordsdk/x86/discord_game_sdk.dll.lib differ