summaryrefslogtreecommitdiffstats
path: root/comm/third_party/json-c/moz.build
diff options
context:
space:
mode:
Diffstat (limited to 'comm/third_party/json-c/moz.build')
-rw-r--r--comm/third_party/json-c/moz.build52
1 files changed, 52 insertions, 0 deletions
diff --git a/comm/third_party/json-c/moz.build b/comm/third_party/json-c/moz.build
new file mode 100644
index 0000000000..788f9856db
--- /dev/null
+++ b/comm/third_party/json-c/moz.build
@@ -0,0 +1,52 @@
+# -*- 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/.
+
+Library("json-c")
+FINAL_LIBRARY = "rnp"
+
+# Honor --with-system-jsonc
+if CONFIG["MZLA_SYSTEM_JSONC"]:
+ OS_LIBS += CONFIG["MZLA_JSONC_LIBS"]
+else:
+ include("../rnpdefs.mozbuild")
+
+ if CONFIG["CC_TYPE"] == "clang-cl":
+ COMPILE_FLAGS["WARNINGS_CFLAGS"] += [
+ "-Wno-macro-redefined",
+ ]
+
+ DEFINES["_GNU_SOURCE"] = True
+ DEFINES["CC"] = CONFIG["_CC"]
+
+ CONFIGURE_DEFINE_FILES += ["config.h", "json_config.h"]
+
+ GeneratedFile(
+ "json.h",
+ script="/python/mozbuild/mozbuild/action/preprocessor.py",
+ entry_point="generate",
+ inputs=["json.h.cmakein"],
+ flags=[
+ "--marker", "%",
+ "-F", "substitution",
+ "-DJSON_H_JSON_POINTER=#include \"json_pointer.h\""
+ ]
+ )
+
+ SOURCES += [
+ "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",
+ ]