• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 Huawei Device Co., Ltd.
2#
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation; either version 2 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11# GNU General Public License for more details.
12import("//build/lite/config/component/lite_component.gni")
13
14config("popt_config") {
15  include_dirs = [ "//third_party/popt/src" ]
16}
17
18popt_sources = [
19  "./src/popt.c",
20  "./src/popthelp.c",
21  "./src/poptint.c",
22  "./src/poptparse.c",
23]
24
25static_library("popt_static") {
26  sources = popt_sources
27  output_name = "popt"
28  public_configs = [ ":popt_config" ]
29  defines = [
30    "HAVE_CONFIG_H",
31    "_GNU_SOURCE",
32    "_REENTRANT",
33  ]
34  cflags_c = [
35    "-Wall",
36    "-Os",
37    "-g",
38    "-W",
39    "-ffunction-sections",
40    "-fdata-sections",
41    "-Wno-unused-const-variable",
42    "-Wno-unused-parameter",
43    "-Wno-gnu-alignof-expression",
44  ]
45  ldflags = [
46    "-Wl",
47    "--gc-sections",
48  ]
49}
50