• 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")
13import("//build/ohos.gni")
14
15config("popt_config") {
16  include_dirs = [ "//third_party/popt/src" ]
17}
18
19popt_sources = [
20  "./src/popt.c",
21  "./src/popthelp.c",
22  "./src/poptint.c",
23  "./src/poptparse.c",
24]
25
26ohos_static_library("popt_static") {
27  sources = popt_sources
28  output_name = "popt"
29  public_configs = [ ":popt_config" ]
30  defines = [
31    "HAVE_CONFIG_H",
32    "_GNU_SOURCE",
33    "_REENTRANT",
34  ]
35  cflags_c = [
36    "-Wall",
37    "-Os",
38    "-g",
39    "-W",
40    "-ffunction-sections",
41    "-fdata-sections",
42    "-Wno-unused-const-variable",
43    "-Wno-unused-parameter",
44    "-Wno-gnu-alignof-expression",
45  ]
46  ldflags = [
47    "-Wl",
48    "--gc-sections",
49  ]
50}
51