I am using MSYS2 UCRT environment to compile a test a C/C++ program and need to link with a third-party library installed on Windows.
installpath = '/c/Program Files (x86)/Foo/Tester'
libpath = installpath + '/bin'
incpath = installpath + '/include/tester/x64'
libfiles = 'msdia140.dll', 'symsrv.dll', 'TesterCore.lib', 'TesterCore.dll'
incfiles = 'tester.h'
How do I define a dependency for this library to compile and link with my test executable?
With compiler.find_library() you can pass your installpath
variable to search for the proper header and libraries. The returned object is a dep, which you can use in dependencies argument of executable. Also you can try Meson: how to make find_library() works with an unusual path? answer.