Skip to content

Commit

Permalink
fixup! Add support for Conan v2
Browse files Browse the repository at this point in the history
  • Loading branch information
dean0x7d committed Apr 27, 2024
1 parent 380eb58 commit 143d1dc
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,22 @@ def generate(self):
build_type = self.settings.build_type.value
tc = CMakeToolchain(self)
tc.variables[f"CMAKE_RUNTIME_OUTPUT_DIRECTORY_{build_type.upper()}"] = "bin"
tc.variables["EXPECTED_PYTHON_CORE_PATH"] = self._core_package_path.as_posix()
tc.variables["EXPECTED_PYTHON_PATH"] = self._package_path.as_posix()
tc.generate()

def build(self):
if conan.__version__.startswith("2"):
sys.path.append(str(self._package_path))
sys.path.append(str(self._package_path))

import embedded_python_tools

embedded_python_tools.symlink_import(self, dst="bin/python")

cmake = CMake(self)
cmake.configure()
cmake.configure(
variables={
"EXPECTED_PYTHON_CORE_PATH": self._core_package_path.as_posix(),
"EXPECTED_PYTHON_PATH": self._package_path.as_posix(),
}
)
cmake.build()

def _test_env(self):
Expand Down

0 comments on commit 143d1dc

Please sign in to comment.