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  '-Wno-pedantic',
21  '-Wno-implicit-fallthrough'
22]
23
24libcr51sign_pre = declare_dependency(
25  include_directories: libcr51sign_includes,
26  compile_args: libcr51sign_cflags,
27  dependencies: libcr51sign_deps)
28
29libcr51sign_lib = library(
30  'cr51sign',
31  'libcr51sign.c',
32  'libcr51sign_support.c',
33  'libcr51sign_mauv.c',
34  dependencies: libcr51sign_pre,
35  c_args: [
36    # Temporarily ignore until updates land
37    '-Wno-error=deprecated-declarations',
38  ],
39  implicit_include_directories: false,
40  version: meson.project_version(),
41  install: true)
42
43libcr51sign_dep = declare_dependency(
44  link_with: libcr51sign_lib,
45  dependencies: libcr51sign_pre)
46
47libcr51sign_reqs = []
48foreach dep : libcr51sign_deps
49  if dep.type_name() == 'pkgconfig'
50    libcr51sign_reqs += dep
51  endif
52endforeach
53
54import('pkgconfig').generate(
55  libcr51sign_lib,
56  name: 'libcr51sign',
57  description: 'CR51 signing verification utilities',
58  requires: libcr51sign_reqs,
59  extra_cflags: libcr51sign_cflags,
60  version: meson.project_version())
61