Skip to content

Commit

Permalink
make: use user variable to set CONAN_MAKE_PROGRAM when using 2 profil…
Browse files Browse the repository at this point in the history
…e build
  • Loading branch information
madebr committed Aug 7, 2021
1 parent 49a5cf1 commit e151430
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions recipes/make/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
from conans import ConanFile, AutoToolsBuildEnvironment, tools
import contextlib


class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"

@contextlib.contextmanager
def _build_context(self):
if hasattr(self, "settings_build"):
# Environments are not inherited when cross building, so manually set the `CONANMAKE_PROGRAM' environment variable
with tools.environment_append({"CONAN_MAKE_PROGRAM": self.deps_user_info["make"].make}):
yield
else:
yield

def test(self):
if not tools.cross_building(self):
with tools.chdir(self.source_folder), tools.remove_from_path("make"):
env_build = AutoToolsBuildEnvironment(self)
env_build.make(args=["love"])
with tools.chdir(self.source_folder):
with self._build_context():
env_build = AutoToolsBuildEnvironment(self)
env_build.make(args=["love"])

0 comments on commit e151430

Please sign in to comment.