|
| 1 | +cmake = import('cmake') |
| 2 | +cmake_opts = cmake.subproject_options() |
| 3 | +cmake_opts.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': true}) |
| 4 | +flatcc_subproj = cmake.subproject('flatcc', options: cmake_opts) |
| 5 | +flatcc_dep = flatcc_subproj.dependency('flatccrt') |
| 6 | + |
| 7 | +nanoarrow_dep = dependency('nanoarrow') |
| 8 | + |
| 9 | +nanoarrow_ipc_lib = library( |
| 10 | + 'nanoarrow_ipc', |
| 11 | + 'nanoarrow_ipc_decoder.c', |
| 12 | + 'nanoarrow_ipc_reader.c', |
| 13 | + dependencies: [flatcc_dep, nanoarrow_dep], |
| 14 | + install: true |
| 15 | +) |
| 16 | + |
| 17 | + |
| 18 | +if get_option('NANOARROW_IPC_BUILD_TESTS') |
| 19 | + arrow_dep = dependency('arrow') |
| 20 | + gtest_dep = dependency('gtest', fallback: ['gtest', 'gtest_main_dep']) |
| 21 | + nlohmann_json_dep = dependency('nlohmann_json') |
| 22 | + zlib_dep = dependency('zlib') |
| 23 | + |
| 24 | + ipc_decoder_test = executable('nanoarrow_ipc_decoder_test', |
| 25 | + 'nanoarrow_ipc_decoder_test.cc', |
| 26 | + link_with: nanoarrow_ipc_lib, |
| 27 | + dependencies: [ |
| 28 | + flatcc_dep, |
| 29 | + nanoarrow_dep, |
| 30 | + arrow_dep, |
| 31 | + gtest_dep, |
| 32 | + ]) |
| 33 | + test('nanoarrow_ipc_decoder_test', ipc_decoder_test) |
| 34 | + |
| 35 | + ipc_reader_test = executable('nanoarrow_ipc_reader_test', |
| 36 | + 'nanoarrow_ipc_reader_test.cc', |
| 37 | + link_with: nanoarrow_ipc_lib, |
| 38 | + dependencies: [ |
| 39 | + flatcc_dep, |
| 40 | + nanoarrow_dep, |
| 41 | + arrow_dep, |
| 42 | + gtest_dep, |
| 43 | + ]) |
| 44 | + test('nanoarrow_ipc_reader_test', ipc_reader_test) |
| 45 | + |
| 46 | + ipc_files_test = executable('nanoarrow_ipc_files_test', |
| 47 | + 'nanoarrow_ipc_files_test.cc', |
| 48 | + link_with: nanoarrow_ipc_lib, |
| 49 | + dependencies: [ |
| 50 | + flatcc_dep, |
| 51 | + nanoarrow_dep, |
| 52 | + arrow_dep, |
| 53 | + gtest_dep, |
| 54 | + nlohmann_json_dep, |
| 55 | + zlib_dep, |
| 56 | + ]) |
| 57 | + test('nanoarrow_ipc_files_test', ipc_files_test) |
| 58 | + |
| 59 | + ipc_hpp_test = executable('nanoarrow_ipc_hpp_test', |
| 60 | + 'nanoarrow_ipc_hpp_test.cc', |
| 61 | + link_with: nanoarrow_ipc_lib, |
| 62 | + dependencies: [ |
| 63 | + flatcc_dep, |
| 64 | + nanoarrow_dep, |
| 65 | + arrow_dep, |
| 66 | + gtest_dep, |
| 67 | + ]) |
| 68 | + test('nanoarrow_ipc_hpp_test', ipc_hpp_test) |
| 69 | +endif |
0 commit comments