spdlog: allow using vendored fmt library (#33379)

This commit is contained in:
Brian Van Essen 2022-10-27 09:13:07 -07:00 committed by GitHub
parent 86337f042e
commit 5f99d3dfaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -45,13 +45,18 @@ class Spdlog(CMakePackage):
version("0.9.0", sha256="bbbe5a855c8b309621352921d650449eb2f741d35d55ec50fb4d8122ddfb8f01") version("0.9.0", sha256="bbbe5a855c8b309621352921d650449eb2f741d35d55ec50fb4d8122ddfb8f01")
variant("shared", default=True, description="Build shared libraries (v1.4.0+)") variant("shared", default=True, description="Build shared libraries (v1.4.0+)")
variant(
"fmt_external",
default=False,
description="Build using external fmt libraries instead of bundled one",
)
depends_on("cmake@3.2:", when="@:1.7.0", type="build") depends_on("cmake@3.2:", when="@:1.7.0", type="build")
depends_on("cmake@3.10:", when="@1.8.0:", type="build") depends_on("cmake@3.10:", when="@1.8.0:", type="build")
depends_on("fmt@5.3:") depends_on("fmt@5.3:", when="+fmt_external")
depends_on("fmt@7:", when="@1.7:") depends_on("fmt@7:", when="@1.7: +fmt_external")
depends_on("fmt@8:", when="@1.9:") depends_on("fmt@8:", when="@1.9: +fmt_external")
def cmake_args(self): def cmake_args(self):
args = [] args = []
@ -60,7 +65,7 @@ def cmake_args(self):
args.extend( args.extend(
[ [
self.define_from_variant("SPDLOG_BUILD_SHARED", "shared"), self.define_from_variant("SPDLOG_BUILD_SHARED", "shared"),
self.define("SPDLOG_FMT_EXTERNAL", "ON"), self.define_from_variant("SPDLOG_FMT_EXTERNAL", "fmt_external"),
# tests and examples # tests and examples
self.define("SPDLOG_BUILD_TESTS", self.run_tests), self.define("SPDLOG_BUILD_TESTS", self.run_tests),
self.define("SPDLOG_BUILD_EXAMPLE", self.run_tests), self.define("SPDLOG_BUILD_EXAMPLE", self.run_tests),