19f07849eSopenharmony_ci# Copyright (c) 2022 Huawei Device Co., Ltd.
29f07849eSopenharmony_ci#
39f07849eSopenharmony_ci# This program is free software; you can redistribute it and/or modify
49f07849eSopenharmony_ci# it under the terms of the GNU General Public License as published by
59f07849eSopenharmony_ci# the Free Software Foundation; either version 2 of the License, or
69f07849eSopenharmony_ci# (at your option) any later version.
79f07849eSopenharmony_ci#
89f07849eSopenharmony_ci# This program is distributed in the hope that it will be useful,
99f07849eSopenharmony_ci# but WITHOUT ANY WARRANTY; without even the implied warranty of
109f07849eSopenharmony_ci# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
119f07849eSopenharmony_ci# GNU General Public License for more details.
129f07849eSopenharmony_ciimport("//build/lite/config/component/lite_component.gni")
139f07849eSopenharmony_ciimport("//build/ohos.gni")
149f07849eSopenharmony_ci
159f07849eSopenharmony_ciconfig("popt_config") {
169f07849eSopenharmony_ci  include_dirs = [ "//third_party/popt/src" ]
179f07849eSopenharmony_ci}
189f07849eSopenharmony_ci
199f07849eSopenharmony_cipopt_sources = [
209f07849eSopenharmony_ci  "./src/popt.c",
219f07849eSopenharmony_ci  "./src/popthelp.c",
229f07849eSopenharmony_ci  "./src/poptint.c",
239f07849eSopenharmony_ci  "./src/poptparse.c",
249f07849eSopenharmony_ci]
259f07849eSopenharmony_ci
269f07849eSopenharmony_ciohos_static_library("popt_static") {
279f07849eSopenharmony_ci  sources = popt_sources
289f07849eSopenharmony_ci  output_name = "popt"
299f07849eSopenharmony_ci  public_configs = [ ":popt_config" ]
309f07849eSopenharmony_ci  defines = [
319f07849eSopenharmony_ci    "HAVE_CONFIG_H",
329f07849eSopenharmony_ci    "_GNU_SOURCE",
339f07849eSopenharmony_ci    "_REENTRANT",
349f07849eSopenharmony_ci  ]
359f07849eSopenharmony_ci  cflags_c = [
369f07849eSopenharmony_ci    "-Wall",
379f07849eSopenharmony_ci    "-Os",
389f07849eSopenharmony_ci    "-g",
399f07849eSopenharmony_ci    "-W",
409f07849eSopenharmony_ci    "-ffunction-sections",
419f07849eSopenharmony_ci    "-fdata-sections",
429f07849eSopenharmony_ci    "-Wno-unused-const-variable",
439f07849eSopenharmony_ci    "-Wno-unused-parameter",
449f07849eSopenharmony_ci    "-Wno-gnu-alignof-expression",
459f07849eSopenharmony_ci  ]
469f07849eSopenharmony_ci  ldflags = [
479f07849eSopenharmony_ci    "-Wl",
489f07849eSopenharmony_ci    "--gc-sections",
499f07849eSopenharmony_ci  ]
509f07849eSopenharmony_ci}
51