Skip to content

Commit

Permalink
(conan-io#25332) json-c: add new version 0.18
Browse files Browse the repository at this point in the history
* json-c: add version 0.18

* link math lib
  • Loading branch information
toge authored Sep 23, 2024
1 parent 99aa5da commit c035f62
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
3 changes: 3 additions & 0 deletions recipes/json-c/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"0.18":
url: "https://github.com/json-c/json-c/archive/json-c-0.18-20240915.tar.gz"
sha256: "3112c1f25d39eca661fe3fc663431e130cc6e2f900c081738317fba49d29e298"
"0.17":
url: "https://github.com/json-c/json-c/archive/json-c-0.17-20230812.tar.gz"
sha256: "024d302a3aadcbf9f78735320a6d5aedf8b77876c8ac8bbb95081ca55054c7eb"
Expand Down
18 changes: 11 additions & 7 deletions recipes/json-c/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from conan import ConanFile
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.files import collect_libs, copy, get, rmdir
from conan.tools.files import copy, get, rmdir
from conan.tools.scm import Version
import os

Expand All @@ -9,13 +9,13 @@

class JSONCConan(ConanFile):
name = "json-c"
package_type = "library"
description = "JSON-C - A JSON implementation in C"
topics = ("json", "encoding", "decoding", "manipulation")
description = "A JSON implementation in C"
license = "MIT"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/json-c/json-c"
license = "MIT"
topics = ("json", "encoding", "decoding", "manipulation")

package_type = "library"
settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
Expand Down Expand Up @@ -64,8 +64,12 @@ def package(self):
rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))

def package_info(self):
self.cpp_info.libs = ["json-c"]

self.cpp_info.set_property("cmake_file_name", "json-c")
self.cpp_info.set_property("cmake_target_name", "json-c::json-c")
self.cpp_info.set_property("pkg_config_name", "json-c")
self.cpp_info.libs = collect_libs(self)
self.cpp_info.includedirs = ["include", "include/json-c"]
self.cpp_info.includedirs = ["include", os.path.join("include", "json-c")]

if Version(self.version) >= "0.17" and self.settings.os in ["Linux", "FreeBSD"]:
self.cpp_info.system_libs.extend(["m",])
2 changes: 2 additions & 0 deletions recipes/json-c/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"0.18":
folder: all
"0.17":
folder: all
"0.16":
Expand Down

0 comments on commit c035f62

Please sign in to comment.