Skip to content

Commit 51d0e27

Browse files
committed
Add patch for windows and fix test.
1 parent 0ebd882 commit 51d0e27

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

recipe/meta.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@ source:
1717
fn: pybind11-{{ version }}.tar.gz
1818
url: https://github.com/pybind/pybind11/archive/v{{ version }}.tar.gz
1919
sha256: {{ sha256 }}
20+
patches: # [win]
21+
- patches/0000_win_fix_paths.patch # [win]
2022

2123
build:
2224
number: 0
2325

26+
requirements:
27+
build: # [win]
28+
- m2-patch # [win]
2429
outputs:
2530
- name: pybind11-abi
2631
version: {{ abi_version }}
@@ -91,7 +96,7 @@ outputs:
9196
- test -f ${PREFIX}/include/pybind11/pybind11.h # [unix]
9297
- if exist %LIBRARY_INC%\pybind11\pybind11.h (exit 0) else (exit 1) # [win]
9398
- test -f $(python -c "import pybind11 as py; print(py.get_include())")/pybind11/pybind11.h # [unix]
94-
- if exist $(python -c "import pybind11 as py; print(py.get_include())")\pybind11\pybind11.h (exit 0) else (exit 1) # [win]
99+
- if not exist %SP_DIR%\pybind11\include\pybind11\pybind11.h exit 1 # [win]
95100

96101
about:
97102
home: https://github.com/pybind/pybind11/
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/setup.py b/setup.py
2+
index 96563c1a..66312029 100644
3+
--- a/setup.py
4+
+++ b/setup.py
5+
@@ -122,10 +122,15 @@ def remove_output(*sources: str) -> Generator[None, None, None]:
6+
with remove_output("pybind11/include", "pybind11/share"):
7+
# Generate the files if they are not present.
8+
with TemporaryDirectory() as tmpdir:
9+
- cmd = ["cmake", "-S", ".", "-B", tmpdir] + [
10+
+ cmd = ["cmake", '-GVisual Studio 16 2019', "-S", ".", "-B", tmpdir] + [
11+
"-DCMAKE_INSTALL_PREFIX=pybind11",
12+
"-DBUILD_TESTING=OFF",
13+
"-DPYBIND11_NOPYTHON=ON",
14+
+ '-DPYTHON_EXECUTABLE:FILEPATH='+os.environ.get("PYTHON",""),
15+
+ '-DPYTHON_LIBRARY:FILEPATH='+os.environ.get("PYTHON_LIBRARY",""),
16+
+ '-DPYTHON_INCLUDE_DIR:PATH='+os.environ.get("PREFIX","")+ '\include',
17+
+ # '-DCMAKE_INSTALL_PREFIX='+os.environ.get("LIBRARY_PREFIX",""),
18+
+ '-DCMAKE_PREFIX_PATH='+os.environ.get("LIBRARY_PREFIX",""),
19+
"-Dprefix_for_pc_file=${pcfiledir}/../../",
20+
]
21+
if "CMAKE_ARGS" in os.environ:
22+

0 commit comments

Comments
 (0)