Skip to content

Commit

Permalink
add +pic and +shared variants
Browse files Browse the repository at this point in the history
see #13
  • Loading branch information
prudhomm committed Oct 29, 2024
1 parent fea2171 commit 61d25cd
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions var/spack/repos/builtin/packages/cpr/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,21 @@ class Cpr(CMakePackage):
homepage = "https://docs.libcpr.org/"
url = "https://github.com/libcpr/cpr/archive/refs/tags/1.10.4.tar.gz"

maintainers("prudhomm")
license("MIT")

version("1.11.0", sha256="fdafa3e3a87448b5ddbd9c7a16e7276a78f28bbe84a3fc6edcfef85eca977784")
version("1.10.5", sha256="c8590568996cea918d7cf7ec6845d954b9b95ab2c4980b365f582a665dea08d8")
version("1.10.4", sha256="88462d059cd3df22c4d39ae04483ed50dfd2c808b3effddb65ac3b9aa60b542d")
version("1.9.2", sha256="3bfbffb22c51f322780d10d3ca8f79424190d7ac4b5ad6ad896de08dbd06bf31")

variant("pic", default=True, description="Position independent code")
variant("shared", default=True, description="Build shared library")

depends_on("cxx", type="build")

depends_on("curl")
depends_on("git", type="build")
depends_on("git", type="build")

def cmake_args(self):
_force = "_FORCE" if self.spec.satisfies("@:1.9") else ""
Expand All @@ -29,4 +35,6 @@ def cmake_args(self):
self.define("CPR_USE_SYSTEM_GTEST", True),
self.define(f"CPR{_force}_USE_SYSTEM_CURL", True),
self.define("CPR_ENABLE_SSL", True),
]
self.define_from_variant("BUILD_SHARED_LIBS", "shared"),
self.define_from_variant("CMAKE_POSITION_INDEPENDENT_CODE", "pic"),
]

0 comments on commit 61d25cd

Please sign in to comment.