2020-04-15 01:29:09 +03:00
|
|
|
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
|
|
|
# vim: set filetype=python:
|
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
2020-10-30 22:05:20 +03:00
|
|
|
Library("json-c")
|
|
|
|
FINAL_LIBRARY = "rnp"
|
2020-04-15 01:29:09 +03:00
|
|
|
|
2020-07-30 01:58:41 +03:00
|
|
|
# Honor --with-system-jsonc
|
2020-10-30 22:05:20 +03:00
|
|
|
if CONFIG["MZLA_SYSTEM_JSONC"]:
|
|
|
|
OS_LIBS += CONFIG["MZLA_JSONC_LIBS"]
|
2020-07-30 01:58:41 +03:00
|
|
|
else:
|
2020-10-30 22:05:20 +03:00
|
|
|
include("../rnpdefs.mozbuild")
|
2020-04-15 01:29:09 +03:00
|
|
|
|
2020-10-30 22:05:20 +03:00
|
|
|
if CONFIG["CC_TYPE"] == "clang-cl":
|
|
|
|
COMPILE_FLAGS["WARNINGS_CFLAGS"] += [
|
|
|
|
"-Wno-macro-redefined",
|
|
|
|
]
|
2020-04-15 01:29:09 +03:00
|
|
|
|
2020-10-30 22:05:20 +03:00
|
|
|
DEFINES["_GNU_SOURCE"] = True
|
|
|
|
DEFINES["CC"] = CONFIG["_CC"]
|
2020-04-15 01:29:09 +03:00
|
|
|
|
2023-11-30 20:55:23 +03:00
|
|
|
GeneratedFile(
|
|
|
|
"config.h",
|
|
|
|
script="/comm/python/thirdroc/thirdroc/cmake_define_files.py",
|
|
|
|
inputs=["cmake/config.h.in"],
|
|
|
|
flags=[
|
|
|
|
"-DPACKAGE_URL=\"\""
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
have_inttypes_h = CONFIG["HAVE_INTTYPES_H"]
|
2023-11-30 20:55:24 +03:00
|
|
|
have_stdint_h = CONFIG["HAVE_STDINT_H"]
|
2023-11-30 20:55:23 +03:00
|
|
|
GeneratedFile(
|
|
|
|
"json_config.h",
|
|
|
|
script="/comm/python/thirdroc/thirdroc/cmake_define_files.py",
|
|
|
|
inputs=["cmake/json_config.h.in"],
|
|
|
|
flags=[
|
|
|
|
f"-DJSON_C_HAVE_INTTYPES_H={have_inttypes_h}",
|
2023-11-30 20:55:24 +03:00
|
|
|
f"-DJSON_C_HAVE_STDINT_H={have_stdint_h}",
|
2023-11-30 20:55:23 +03:00
|
|
|
]
|
|
|
|
)
|
2020-04-15 01:29:09 +03:00
|
|
|
|
2022-09-13 20:41:15 +03:00
|
|
|
GeneratedFile(
|
|
|
|
"json.h",
|
|
|
|
script="/python/mozbuild/mozbuild/action/preprocessor.py",
|
|
|
|
entry_point="generate",
|
|
|
|
inputs=["json.h.cmakein"],
|
|
|
|
flags=[
|
|
|
|
"--marker", "%",
|
|
|
|
"-F", "substitution",
|
2023-11-30 20:55:23 +03:00
|
|
|
"-DJSON_H_JSON_POINTER=#include \"json_pointer.h\"",
|
2023-11-30 20:55:24 +03:00
|
|
|
"-DJSON_H_JSON_PATCH=#include \"json_patch.h\"",
|
2022-09-13 20:41:15 +03:00
|
|
|
]
|
|
|
|
)
|
|
|
|
|
2020-07-30 01:58:41 +03:00
|
|
|
SOURCES += [
|
2020-10-30 22:05:20 +03:00
|
|
|
"arraylist.c",
|
|
|
|
"debug.c",
|
|
|
|
"json_c_version.c",
|
|
|
|
"json_object.c",
|
|
|
|
"json_object_iterator.c",
|
|
|
|
"json_pointer.c",
|
|
|
|
"json_tokener.c",
|
|
|
|
"json_util.c",
|
|
|
|
"json_visit.c",
|
|
|
|
"linkhash.c",
|
|
|
|
"printbuf.c",
|
|
|
|
"random_seed.c",
|
|
|
|
"strerror_override.c",
|
2020-07-30 01:58:41 +03:00
|
|
|
]
|