using a conanfile.py to call meson

This commit is contained in:
Florent Leclercq 2023-03-17 17:49:08 +01:00
parent 3e21336c78
commit 7fab978ae7
3 changed files with 34 additions and 15 deletions

View file

@ -12,14 +12,12 @@ conan profile detect --force
```
* Install dependencies with conan
```
conan install . --output-folder=build --build=missing
conan install . --output-folder=build_debug --build=missing --profile=debug
conan install . --build=missing
conan install . --build=missing --profile=debug
```
* Build with meson
```
cd build
source conanbuild.sh
meson setup --native-file conan_meson_native.ini .. meson-src
meson compile -C meson-src
source deactivate_conanbuild.sh
conan build .
conan build . --profile=debug
```

30
conanfile.py Normal file
View file

@ -0,0 +1,30 @@
from conan import ConanFile
from conan.tools.meson import Meson
class ElemmireRecipe(ConanFile):
name = "Elemmire"
version = "0.1"
settings = "os", "compiler", "build_type", "arch"
generators = "PkgConfigDeps", "MesonToolchain"
exports_sources = "src/*"
def requirements(self):
self.requires("fftw/[~3.3]")
def build_requirements(self):
self.tool_requires("meson/[~1.0]")
def layout(self):
import os.path
from conan.tools.layout import basic_layout
basic_layout(self)
self.folders.build = os.path.join(self.folders.build, "meson")
def build(self):
meson = Meson(self)
meson.configure()
meson.build()
def package(self):
meson = Meson(self)
meson.install()

View file

@ -1,9 +0,0 @@
[requires]
fftw/3.3.9
[tool_requires]
meson/1.0.0
[generators]
PkgConfigDeps
MesonToolchain