Add support for building tinc with MSVC
[tinc] / src / mingw / meson.build
index 796d62b..5cd2c7b 100644 (file)
@@ -1,11 +1,17 @@
-win_common_libs = ['ws2_32', 'iphlpapi', 'winpthread']
+check_headers += 'w32api.h'
 
-if opt_harden
+win_common_libs = ['ws2_32', 'iphlpapi', 'threads']
+
+if opt_harden and cc_name != 'msvc'
   win_common_libs += 'ssp'
 endif
 
 foreach libname : win_common_libs
-  deps_common += cc.find_library(libname)
+  dep = dependency(libname, required: false)
+  if not dep.found()
+    dep = cc.find_library(libname)
+  endif
+  deps_common += dep
 endforeach
 
 src_tincd += files('device.c')