|
| 1 | +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | + |
| 16 | +# Check for liburing dependency |
| 17 | +liburing_dep = dependency('liburing', required: true) |
| 18 | + |
| 19 | +# Get Abseil dependencies |
| 20 | +absl_log_dep = dependency('absl_log', required: true) |
| 21 | + |
| 22 | +if 'POSIX' in static_plugins |
| 23 | + posix_backend_lib = static_library('POSIX', 'posix_backend.cpp', 'posix_backend.h', 'posix_plugin.cpp', |
| 24 | + dependencies: [nixl_infra, liburing_dep, absl_log_dep], |
| 25 | + link_args: ['-luring'], |
| 26 | + include_directories: [nixl_inc_dirs, utils_inc_dirs], |
| 27 | + install: false, |
| 28 | + cpp_args: compile_flags, |
| 29 | + name_prefix: 'libplugin_') # Custom prefix for plugin libraries |
| 30 | +else |
| 31 | + posix_backend_lib = shared_library('POSIX', 'posix_backend.cpp', 'posix_backend.h', 'posix_plugin.cpp', |
| 32 | + dependencies: [nixl_infra, liburing_dep, absl_log_dep], |
| 33 | + include_directories: [nixl_inc_dirs, utils_inc_dirs], |
| 34 | + link_args: ['-luring'], |
| 35 | + install: true, |
| 36 | + cpp_args: ['-fPIC'], |
| 37 | + name_prefix: 'libplugin_', # Custom prefix for plugin libraries |
| 38 | + install_dir: plugin_install_dir) |
| 39 | + if get_option('buildtype') == 'debug' |
| 40 | + run_command('sh', '-c', |
| 41 | + 'echo "POSIX=' + posix_backend_lib.full_path() + '" >> ' + plugin_build_dir + '/pluginlist', |
| 42 | + check: true |
| 43 | + ) |
| 44 | + endif |
| 45 | +endif |
| 46 | + |
| 47 | +posix_backend_interface = declare_dependency(link_with: posix_backend_lib) |
0 commit comments