Skip to content

Commit

Permalink
build: package_type is dynamically set in conanfile.py depending if…
Browse files Browse the repository at this point in the history
… we build modules or not
  • Loading branch information
mpusz committed Sep 27, 2024
1 parent 562c2e1 commit 5f2cb78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
- build: `generate()` in `test_package` now correctly propagates project's options
- build: `target_include_directories` is not needed anymore
- build: `target_compile_features` now uses `CMAKE_CXX_STANDARD`
- build: `package_type` is dynamically set in conanfile.py depending if we build modules or not
- ci: added test for upstream clang on macos-14, as an example for an arm64 platform by [@burnpanck](https://github.com/burnpanck)
- style: pre-commit updated to clang-format-18.1.8
- docs: "Strong Angular System" chapter added
Expand Down
11 changes: 7 additions & 4 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ class MPUnitsConan(ConanFile):
"example/*",
"CMakeLists.txt",
)
package_type = "header-library"
no_copy_source = True

@property
Expand Down Expand Up @@ -204,17 +203,21 @@ def config_options(self):
self._set_default_option(key)

def configure(self):
if self.options.cxx_modules:
self.package_type = "static-library"
else:
self.package_type = "header-library"
if self.options.freestanding:
self.options.rm_safe("std_format")

def requirements(self):
if not self.options.freestanding:
if self.options.contracts == "gsl-lite":
self.requires("gsl-lite/0.41.0")
self.requires("gsl-lite/0.41.0", transitive_headers=True)
elif self.options.contracts == "ms-gsl":
self.requires("ms-gsl/4.0.0")
self.requires("ms-gsl/4.0.0", transitive_headers=True)
if not self.options.std_format:
self.requires("fmt/11.0.1")
self.requires("fmt/11.0.1", transitive_headers=True)

def build_requirements(self):
self.tool_requires("cmake/[>=3.30 <4]")
Expand Down

0 comments on commit 5f2cb78

Please sign in to comment.