added MesonToolchain in recipe

This commit is contained in:
Florent Leclercq 2023-07-06 20:26:17 +02:00
parent ec70626be3
commit 956aed934f
2 changed files with 8 additions and 6 deletions

View file

@ -21,13 +21,11 @@ conan profile detect --force
```
* Build with meson
```
cd build-realease
conan build ..
cd build-release ; conan build .. ; cd ..
```
or for the debug version:
```
cd build-debug
conan build .. --profile=debug
cd build-debug ; conan build .. --profile=debug ; cd ..
```
* To create the package (i.e. build and install it in the conan cache ``~/.conan2``):
```

View file

@ -1,6 +1,6 @@
import os.path
from conan import ConanFile
from conan.tools.meson import Meson
from conan.tools.meson import Meson, MesonToolchain
from conan.tools.layout import basic_layout
class ElemmireRecipe(ConanFile):
@ -15,7 +15,7 @@ class ElemmireRecipe(ConanFile):
topics = ("cosmology", "data analysis")
# Binary configuration
generators = "PkgConfigDeps", "MesonToolchain"
generators = "PkgConfigDeps"
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False], "fPIC": [True, False]}
default_options = {"shared": False, "fPIC": True}
@ -33,6 +33,10 @@ class ElemmireRecipe(ConanFile):
basic_layout(self)
self.folders.build = os.path.join(self.folders.build, "meson")
def generate(self):
tc = MesonToolchain(self)
tc.generate()
def build(self):
meson = Meson(self)
meson.configure()