Link Against Existing `.lib` File in Meson Build on Windows

佐手、 提交于 2019-12-06 16:04:58

OK, I found solution on MesonBuild: How to define dependency to a library that cannot be found by pkg-config? on Yasushi Shoji's answer.

The only issue the dirs property requires Absolute Path.
Hence this is a sketch of what can be done:

# Constants
projectDir  = meson.current_source_dir() # MESON_SOURCE_ROOT
buildDir    = meson.current_build_dir() # MESON_BUILD_ROOT

lib1Path = join_paths(projectDir, 'Lib')
lib2Path = join_paths(projectDir, 'Lib')

objCCompiler = meson.get_compiler('c')

MyLib1 = objCCompiler.find_library('MyLib1', dirs : lib1Path)
MyLib2 = objCCompiler.find_library('MyLib1', dirs : lib1Pat2)

Now just to define the target build with the proper dependencies.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!