Skip to content

Commit

Permalink
build(conan): freestanding support refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
mpusz committed Jun 10, 2024
1 parent e90cffc commit bb3b9c4
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,13 @@ def set_version(self):
self.version = version.strip()

def requirements(self):
if self.options.contracts == "gsl-lite":
self.requires("gsl-lite/0.41.0")
elif self.options.contracts == "ms-gsl":
self.requires("ms-gsl/4.0.0")
if self._use_fmtlib and not self.options.freestanding:
self.requires("fmt/10.2.1")
if not self.options.freestanding:
if self.options.contracts == "gsl-lite":
self.requires("gsl-lite/0.41.0")
elif self.options.contracts == "ms-gsl":
self.requires("ms-gsl/4.0.0")
if self._use_fmtlib:
self.requires("fmt/10.2.1")

def build_requirements(self):
if self._build_all:
Expand Down Expand Up @@ -248,17 +249,19 @@ def generate(self):
tc.cache_variables["MP_UNITS_BUILD_CXX_MODULES"] = str(
self.options.cxx_modules
).upper()
tc.cache_variables["MP_UNITS_API_STD_FORMAT"] = str(
self.options.std_format
).upper()
if self.options.freestanding:
tc.cache_variables["MP_UNITS_API_FREESTANDING"] = True
else:
tc.cache_variables["MP_UNITS_API_STD_FORMAT"] = str(
self.options.std_format
).upper()
tc.cache_variables["MP_UNITS_API_STRING_VIEW_RET"] = str(
self.options.string_view_ret
).upper()
tc.cache_variables["MP_UNITS_API_NO_CRTP"] = str(self.options.no_crtp).upper()
tc.cache_variables["MP_UNITS_API_CONTRACTS"] = str(
self.options.contracts
).upper()
tc.cache_variables["MP_UNITS_API_FREESTANDING"] = self.options.freestanding
tc.generate()
deps = CMakeDeps(self)
deps.generate()
Expand Down

0 comments on commit bb3b9c4

Please sign in to comment.