1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
|
// SPDX-License-Identifier: GPL-2.0-or-later
// SPDX-FileCopyrightText: 2023 Benjamin Li <benl@squareup.com>
// Instructions:
// - Check out this repository as external/libgpiod.
// - Move this build file to the project's root directory.
//
// libgpiod main library
//
cc_library {
name: "libgpiod",
defaults: [
"libgpiod_defaults",
],
srcs: [
"lib/*.c",
"bindings/cxx/*.cpp",
],
export_include_dirs: [
"include",
"bindings/cxx",
],
}
cc_defaults {
name: "libgpiod_defaults",
device_specific: true,
cpp_std: "gnu++17",
cflags: [
// You may want to edit this with the version from configure.ac of
// the release you are using.
"-DGPIOD_VERSION_STR=\"unstable\"",
],
cppflags: [
// Google C++ style is to not use exceptions, but this library does
// use them.
"-fexceptions",
],
// Google C++ style is to not use runtime type information, but this
// library does use it.
rtti: true,
}
//
// libgpiod tools
//
phony {
name: "libgpiod_tools",
required: [
"gpiodetect",
"gpioget",
"gpioinfo",
"gpiomon",
"gpionotify",
"gpioset",
],
}
cc_binary {
name: "gpiodetect",
defaults: [
"libgpiod_defaults",
"libgpiod_tools_defaults",
],
srcs: [
"tools/gpiodetect.c",
],
}
cc_binary {
name: "gpioget",
defaults: [
"libgpiod_defaults",
"libgpiod_tools_defaults",
],
srcs: [
"tools/gpioget.c",
],
}
cc_binary {
name: "gpioinfo",
defaults: [
"libgpiod_defaults",
"libgpiod_tools_defaults",
],
srcs: [
"tools/gpioinfo.c",
],
}
cc_binary {
name: "gpiomon",
defaults: [
"libgpiod_defaults",
"libgpiod_tools_defaults",
],
srcs: [
"tools/gpiomon.c",
],
}
cc_binary {
name: "gpionotify",
defaults: [
"libgpiod_defaults",
"libgpiod_tools_defaults",
],
srcs: [
"tools/gpionotify.c",
],
}
cc_binary {
name: "gpioset",
defaults: [
"libgpiod_defaults",
"libgpiod_tools_defaults",
],
srcs: [
"tools/gpioset.c",
],
}
cc_defaults {
name: "libgpiod_tools_defaults",
srcs: [
"tools/tools-common.c",
],
shared_libs: [
"libgpiod",
],
}
|