Skip to content

Commit

Permalink
nanobind: fix test_package for shared cpython
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Oct 3, 2024
1 parent 87fa83c commit 30bcd6e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion recipes/nanobind/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from conan import ConanFile
from conan.tools.build import can_run
from conan.tools.cmake import cmake_layout, CMake
from conan.tools.env import VirtualRunEnv


class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv", "VirtualBuildEnv"
generators = "CMakeDeps", "CMakeToolchain", "VirtualBuildEnv"
test_type = "explicit"

def requirements(self):
Expand All @@ -21,6 +22,11 @@ def build_requirements(self):
def layout(self):
cmake_layout(self)

def generate(self):
VirtualRunEnv(self).generate()
# Required for find_package(Python) to work with cpython/*:shared=True
VirtualRunEnv(self).generate(scope="build")

def build(self):
cmake = CMake(self)
cmake.configure()
Expand Down

0 comments on commit 30bcd6e

Please sign in to comment.