1*7a33704cSNan Zhou# Copyright 2021 Google LLC
2*7a33704cSNan Zhou#
3*7a33704cSNan Zhou# Licensed under the Apache License, Version 2.0 (the "License");
4*7a33704cSNan Zhou# you may not use this file except in compliance with the License.
5*7a33704cSNan Zhou# You may obtain a copy of the License at
6*7a33704cSNan Zhou#
7*7a33704cSNan Zhou#      http://www.apache.org/licenses/LICENSE-2.0
8*7a33704cSNan Zhou#
9*7a33704cSNan Zhou# Unless required by applicable law or agreed to in writing, software
10*7a33704cSNan Zhou# distributed under the License is distributed on an "AS IS" BASIS,
11*7a33704cSNan Zhou# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*7a33704cSNan Zhou# See the License for the specific language governing permissions and
13*7a33704cSNan Zhou# limitations under the License.
14*7a33704cSNan Zhou
15*7a33704cSNan Zhouproject('libcr51sign', 'c',
16*7a33704cSNan Zhou        version: '0.1', meson_version: '>=0.57.0',
17*7a33704cSNan Zhou        default_options: [
18*7a33704cSNan Zhou          'warning_level=2',
19*7a33704cSNan Zhou          'werror=false',
20*7a33704cSNan Zhou          'cpp_std=c++20'
21*7a33704cSNan Zhou        ])
22*7a33704cSNan Zhou
23*7a33704cSNan Zhou# libssl part of openssl isn't used.
24*7a33704cSNan Zhouopenssl = dependency('libcrypto')
25*7a33704cSNan Zhou
26*7a33704cSNan Zhoulibcr51sign_headers = include_directories('.')
27*7a33704cSNan Zhou
28*7a33704cSNan Zhoulibcr51sign_lib = library(
29*7a33704cSNan Zhou  'libcr51sign',
30*7a33704cSNan Zhou  'libcr51sign.c',
31*7a33704cSNan Zhou  'libcr51sign_support.c',
32*7a33704cSNan Zhou  include_directories: libcr51sign_headers,
33*7a33704cSNan Zhou  dependencies: openssl,
34*7a33704cSNan Zhou  implicit_include_directories: false,
35*7a33704cSNan Zhou  version: meson.project_version(),
36*7a33704cSNan Zhou  install: true)
37*7a33704cSNan Zhou
38*7a33704cSNan Zhoupkg = import('pkgconfig')
39*7a33704cSNan Zhoupkg.generate(
40*7a33704cSNan Zhou  libcr51sign_lib,
41*7a33704cSNan Zhou  name: 'libcr51sign',
42*7a33704cSNan Zhou  description: 'CR51 signing verification utilities',
43*7a33704cSNan Zhou  requires: openssl,
44*7a33704cSNan Zhou  version: meson.project_version())
45*7a33704cSNan Zhou
46*7a33704cSNan Zhouinstall_headers(
47*7a33704cSNan Zhou  'cr51_image_descriptor.h',
48*7a33704cSNan Zhou  'libcr51sign.h',
49*7a33704cSNan Zhou  'libcr51sign_support.h',
50*7a33704cSNan Zhou  subdir: 'libcr51sign')
51