Instead of using a generator and having to deal with tweaking the inclusion paths, we can use a custom target rule, which will do the right thing and put the generate files where we expect them to be. Due to how Meson and Ninja work we need to be a bit more careful as to how we deal with dependencies and generated files, especially since Epoxy is built on the assumption that the only inclusion path for the headers lies under the 'include' sub-directory. First of all, we need to split the dispatch table generation into two separate steps, one for the headers and one for the source files. Additionally, we need to munge the paths of the non-generated headers so that we reference them by their correct path. These changes are necessary to ensure that Epoxy can be built on a system without Epoxy installed already; the previous Meson-based build system relied on the headers being installed in a system directory.macos/v1.5.9
parent
08cc4d021d
commit
59318edf64
@ -0,0 +1,80 @@ |
||||
gl_generated = custom_target('gl_generated.h', |
||||
input: gl_registry, |
||||
output: [ |
||||
'gl_generated.h', |
||||
], |
||||
command: [ |
||||
python, |
||||
gen_dispatch_py, |
||||
'--header', |
||||
'--no-source', |
||||
'--outputdir=' + meson.current_build_dir(), |
||||
'@INPUT@' |
||||
], |
||||
install: true, |
||||
install_dir: join_paths(epoxy_includedir, 'epoxy')) |
||||
|
||||
gen_headers = [ gl_generated ] |
||||
headers = [ 'gl.h', ] |
||||
|
||||
if build_egl |
||||
egl_generated = custom_target('egl_generated.h', |
||||
input: egl_registry, |
||||
output: [ |
||||
'egl_generated.h', |
||||
], |
||||
command: [ |
||||
python, |
||||
gen_dispatch_py, |
||||
'--header', |
||||
'--no-source', |
||||
'--outputdir=' + meson.current_build_dir(), |
||||
'@INPUT@' |
||||
], |
||||
install: true, |
||||
install_dir: join_paths(epoxy_includedir, 'epoxy')) |
||||
gen_headers += [ egl_generated ] |
||||
headers += [ 'egl.h' ] |
||||
endif |
||||
|
||||
if build_glx |
||||
glx_generated = custom_target('glx_generated.h', |
||||
input: glx_registry, |
||||
output: [ |
||||
'glx_generated.h', |
||||
], |
||||
command: [ |
||||
python, |
||||
gen_dispatch_py, |
||||
'--header', |
||||
'--no-source', |
||||
'--outputdir=' + meson.current_build_dir(), |
||||
'@INPUT@' |
||||
], |
||||
install: true, |
||||
install_dir: join_paths(epoxy_includedir, 'epoxy')) |
||||
gen_headers += [ glx_generated ] |
||||
headers += [ 'glx.h' ] |
||||
endif |
||||
|
||||
if build_wgl |
||||
wgl_generated = custom_target('wgl_generated.h', |
||||
input: wgl_registry, |
||||
output: [ |
||||
'wgl_generated.h', |
||||
], |
||||
command: [ |
||||
python, |
||||
gen_dispatch_py, |
||||
'--header', |
||||
'--no-source', |
||||
'--outputdir=' + meson.current_build_dir(), |
||||
'@INPUT@' |
||||
], |
||||
install: true, |
||||
install_dir: join_paths(epoxy_includedir, 'epoxy')) |
||||
gen_headers += [ wgl_generated ] |
||||
headers += [ 'wgl.h' ] |
||||
endif |
||||
|
||||
install_headers(headers, subdir: 'epoxy') |
Loading…
Reference in new issue