@@ -77,10 +77,17 @@ c = meson.get_compiler('c')
7777
7878lib_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
8289discord_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(
8996if discord_lib_c.found()
9097 lib_deps += discord_lib_c
9198else
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
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