Skip to content

Commit 6cba117

Browse files
committed
fix msvc library name
1 parent 4fc105c commit 6cba117

File tree

1 file changed

+14
-27
lines changed
  • subprojects/packagefiles/discord_game_sdk/cpp

1 file changed

+14
-27
lines changed

subprojects/packagefiles/discord_game_sdk/cpp/meson.build

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,17 @@ c = meson.get_compiler('c')
7777

7878
lib_deps = []
7979

80-
## prefrerring the static vartiant, if not found we need to copy the danmic lib to the libdir on installation!
80+
## prefrerring the static variant, if not found we need to copy the danmic lib to the libdir on installation!
81+
82+
lib_name = 'discord_game_sdk'
83+
84+
if c.get_id() == 'msvc'
85+
lib_name = 'discord_game_sdk.dll'
86+
endif
87+
8188

8289
discord_lib_c = c.find_library(
83-
'discord_game_sdk',
90+
lib_name,
8491
dirs: [meson.project_source_root() / lib_dir],
8592
static: true,
8693
required: false,
@@ -89,30 +96,10 @@ discord_lib_c = c.find_library(
8996
if discord_lib_c.found()
9097
lib_deps += discord_lib_c
9198
else
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
99+
lib_deps += c.find_library(
100+
lib_name,
101+
dirs: [meson.project_source_root() / lib_dir],
102+
)
116103

117104
dynamic_lib_rename = dynamic_lib
118105

@@ -146,7 +133,7 @@ else
146133
)
147134

148135
run_command(
149-
'cp',
136+
find_program('cp'),
150137
meson.project_source_root() / lib_dir / dynamic_lib,
151138
meson.project_source_root() / lib_dir / dynamic_lib_rename,
152139
check: true,

0 commit comments

Comments
 (0)