1# Copyright 2021 Google LLC
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15libcr51sign_deps = [
16  dependency('libcrypto'),
17]
18
19libcr51sign_cflags = [
20  '-DOMIT_VARIABLE_ARRAYS',
21]
22
23libcr51sign_pre = declare_dependency(
24  include_directories: libcr51sign_includes,
25  compile_args: libcr51sign_cflags,
26  dependencies: libcr51sign_deps)
27
28libcr51sign_lib = library(
29  'cr51sign',
30  'libcr51sign.c',
31  'libcr51sign_support.c',
32  dependencies: libcr51sign_pre,
33  implicit_include_directories: false,
34  version: meson.project_version(),
35  install: true)
36
37libcr51sign_dep = declare_dependency(
38  link_with: libcr51sign_lib,
39  dependencies: libcr51sign_pre)
40
41libcr51sign_reqs = []
42foreach dep : libcr51sign_deps
43  if dep.type_name() == 'pkgconfig'
44    libcr51sign_reqs += dep
45  endif
46endforeach
47
48import('pkgconfig').generate(
49  libcr51sign_lib,
50  name: 'libcr51sign',
51  description: 'CR51 signing verification utilities',
52  requires: libcr51sign_reqs,
53  extra_cflags: libcr51sign_cflags,
54  version: meson.project_version())
55