forked from conan-io/conan-center-index
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conanfile.py
29 lines (23 loc) · 1020 Bytes
/
conanfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import os
from conans import ConanFile, tools
from conan.tools.cmake import CMake
from conan.tools.layout import cmake_layout
class TestZlibConan(ConanFile):
settings = "os", "compiler", "arch", "build_type"
generators = "CMakeDeps", "CMakeToolchain", "PkgConfigDeps", "VirtualRunEnv"
def configure(self):
del self.settings.compiler.libcxx
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def layout(self):
cmake_layout(self)
def generate(self):
# Necessary modernization, as test() doesn't have self.dependencies yet.
assert os.path.exists(os.path.join(self.dependencies["zlib"].package_folder, "licenses", "LICENSE"))
def test(self):
assert os.path.exists(os.path.join(self.generators_folder, "zlib.pc"))
if "x86" in self.settings.arch and not tools.cross_building(self.settings):
cmd = os.path.join(self.cpp.build.bindirs[0], "test")
self.run(cmd, env="conanrunenv")