Skip to content

Commit 4fc105c

Browse files
committed
try to fix discord game sdk error for msvc
1 parent ded06f1 commit 4fc105c

File tree

1 file changed

+26
-6
lines changed
  • subprojects/packagefiles/discord_game_sdk/cpp

1 file changed

+26
-6
lines changed

subprojects/packagefiles/discord_game_sdk/cpp/meson.build

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,30 @@ discord_lib_c = c.find_library(
8989
if discord_lib_c.found()
9090
lib_deps += discord_lib_c
9191
else
92-
lib_deps += c.find_library(
93-
'discord_game_sdk',
94-
dirs: [meson.project_source_root() / lib_dir],
95-
)
92+
93+
if host_machine.system() == 'windows'
94+
95+
discord_lib_c = c.find_library(
96+
'discord_game_sdk',
97+
dirs: [meson.project_source_root() / lib_dir],
98+
required: false,
99+
)
100+
101+
if discord_lib_c.found()
102+
lib_deps += discord_lib_c
103+
else
104+
lib_deps += c.find_library(
105+
'discord_game_sdk.dll',
106+
dirs: [meson.project_source_root() / lib_dir],
107+
)
108+
endif
109+
else
110+
lib_deps += c.find_library(
111+
'discord_game_sdk',
112+
dirs: [meson.project_source_root() / lib_dir],
113+
)
114+
115+
endif
96116

97117
dynamic_lib_rename = dynamic_lib
98118

@@ -113,7 +133,7 @@ else
113133

114134
else
115135
message('discord game sdk has no SONAME')
116-
136+
117137
patchelf = find_program('patchelf')
118138

119139
#TODO: file issue to discord, to set SONAME
@@ -126,7 +146,7 @@ else
126146
)
127147

128148
run_command(
129-
find_program('cp'),
149+
'cp',
130150
meson.project_source_root() / lib_dir / dynamic_lib,
131151
meson.project_source_root() / lib_dir / dynamic_lib_rename,
132152
check: true,

0 commit comments

Comments
 (0)