Skip to content

Commit

Permalink
fix: Meson install header files and pkgconfig (#542)
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAyd authored Jun 25, 2024
1 parent 749349d commit 61dc743
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,7 @@ if(NANOARROW_IPC)
$<INSTALL_INTERFACE:include>)

install(TARGETS nanoarrow_ipc DESTINATION lib)
install(FILES src/nanoarrow/nanoarrow_ipc.h
src/nanoarrow/nanoarrow_ipc_flatcc_generated.h
install(FILES src/nanoarrow/nanoarrow_ipc.h src/nanoarrow/ipc/flatcc_generated.h
DESTINATION include/nanoarrow)
endif()

Expand Down
27 changes: 27 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@ endif
subdir('src/nanoarrow')
incdir = include_directories('src/')

install_headers(
'src/nanoarrow/nanoarrow.h',
'src/nanoarrow/nanoarrow.hpp',
subdir: 'nanoarrow',
)

install_headers(
'src/nanoarrow/common/inline_array.h',
'src/nanoarrow/common/inline_buffer.h',
'src/nanoarrow/common/inline_types.h',
subdir: 'nanoarrow/common',
)

nanoarrow_lib = library(
'nanoarrow',
'src/nanoarrow/common/array.c',
Expand All @@ -60,6 +73,12 @@ nanoarrow_dep = declare_dependency(include_directories: [incdir],
if get_option('ipc')
flatcc_dep = dependency('flatcc')

install_headers(
'src/nanoarrow/nanoarrow_ipc.h',
'src/nanoarrow/ipc/flatcc_generated.h',
subdir: 'nanoarrow'
)

nanoarrow_ipc_lib = library(
'nanoarrow_ipc',
'src/nanoarrow/ipc/decoder.c',
Expand Down Expand Up @@ -91,6 +110,11 @@ if needs_device
error('CUDA support with the Meson build system is not implemented')
endif

install_headers(
'src/nanoarrow/nanoarrow_device.h',
subdir: 'nanoarrow',
)

nanoarrow_device_lib = library(
'nanoarrow_device',
sources: device_srcs,
Expand Down Expand Up @@ -250,3 +274,6 @@ if get_option('apps')
)
endif
endif

pkg = import('pkgconfig')
pkg.generate(nanoarrow_lib)
10 changes: 7 additions & 3 deletions src/nanoarrow/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ conf_data.set('NANOARROW_VERSION_MAJOR', ver_major)
conf_data.set('NANOARROW_VERSION_MINOR', ver_minor)
conf_data.set('NANOARROW_VERSION_PATCH', ver_patch)

configure_file(input: 'nanoarrow_config.h.in',
output: 'nanoarrow_config.h',
configuration: conf_data)
configure_file(
input: 'nanoarrow_config.h.in',
output: 'nanoarrow_config.h',
configuration: conf_data,
install: true,
install_dir: get_option('includedir') / 'nanoarrow',
)

0 comments on commit 61dc743

Please sign in to comment.