0

Here is my meson.build:

project('Adventum', 'cpp', version : '0.1.0', license : '', default_options : ['cpp_std=c++2a'])

glfw = subproject('glfw').get_variable('glfw_dep')
vulkan = dependency('vulkan')   

sources = ['src/main.cpp', 'src/render/window.cpp']

exe = executable('Adventum', sources, include_directories : 'src', dependencies : [glfw, vulkan])

and here is my 'subproject" (wrap):

[wrap-git]
url = https://github.com/henry4k/glfw-meson.git
revision = head

I'm using the GLFW library but I have to pull from a third-party fork that supports meson. This all works fine, and meson successfully downloads and builds the GLFW fork, but even though meson should clearly know that my project depends on the GLFW library it doesn't actually place the GLFW binaries alongside my projects executable, so it builds the dependency but my program cannot run because it doesn't find the necessary binaries.

Is there something I must specify in my meson.build for it to automatically place the binaries next to my executeable?

小奥利奥
  • 231
  • 2
  • 9

1 Answers1

2

if you do not specify a directory name or a [provide] section with dependency_names, the file name of the .wrap will determine how the subproject is called. So, in case your wrap file was called glfw-meson.wrap your subproject could be referenced with glfw-meson only.

Better practice is to specify directory:

[wrap-git]
directory = glfw
url = https://github.com/henry4k/glfw-meson.git
revision = head

or dependency_names:

[wrap-git]
url = https://github.com/henry4k/glfw-meson.git
revision = head

[provide]
dependency_names = glfw

Then, you should be able to call subproject('glfw')

blubase
  • 795
  • 7
  • 19