• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14project(miniz)
15
16add_library(miniz ${MINIZ_ROOT}/miniz.c)
17target_include_directories(miniz PUBLIC ${MINIZ_ROOT})
18
19target_compile_options(miniz PUBLIC -Wno-return-type-c-linkage)
20
21# NB! We always build miniz statically, but there seems
22# no obvious reasons for that. If we reconsider, the logic
23# below should be replaced with something like:
24#
25# add_library(miniz ${PANDA_DEFAULT_LIB_TYPE} miniz.c)
26#
27# **Besides** build of host tools should be fixed to
28# take into account new shared library
29if(NOT PANDA_TARGET_WINDOWS)
30    target_compile_options(miniz PRIVATE -fPIC)
31endif()
32
33if (PANDA_ENABLE_AFL)
34    include("${PANDA_ROOT}/fuzzing/Fuzzing.cmake")
35    panda_substitute_libs(TARGET miniz)
36endif()
37