File tree Expand file tree Collapse file tree 3 files changed +33
-5
lines changed Expand file tree Collapse file tree 3 files changed +33
-5
lines changed Original file line number Diff line number Diff line change @@ -31,4 +31,15 @@ def cmake_args(self):
3131 args .append (self .define ('USE_PYTHON_3' , int (self .spec ['python' ].version [0 ]) >= 3 ))
3232 args .append (self .define ('USE_PYTHON_2' , int (self .spec ['python' ].version [0 ]) < 3 ))
3333
34+ # Fix cmake taking python3 even if `which python` is python2
35+ py = self .spec ['python' ]
36+ args .extend ([
37+ # find_package(PythonInterp) # Deprecated, but used by pybind11
38+ self .define ('PYTHON_EXECUTABLE' , py .command .path ),
39+ # find_package(Python) under cmake_minimum_required < 3.15 (CMP0094)
40+ self .define ('Python_EXECUTABLE' , py .command .path ),
41+ # find_package(Python2/3) under cmake_minimum_required < 3.15 (CMP0094)
42+ self .define ('Python{}_EXECUTABLE' .format (py .version [0 ]), py .command .path ),
43+ ])
44+
3445 return args
Original file line number Diff line number Diff line change @@ -52,4 +52,15 @@ def cmake_args(self):
5252
5353 args .append ('-DBUILD_PY_CONSOLE:BOOL=ON' )
5454
55+ # Fix cmake taking python3 even if `which python` is python2
56+ py = self .spec ['python' ]
57+ args .extend ([
58+ # find_package(PythonInterp) # Deprecated, but used by pybind11
59+ self .define ('PYTHON_EXECUTABLE' , py .command .path ),
60+ # find_package(Python) under cmake_minimum_required < 3.15 (CMP0094)
61+ self .define ('Python_EXECUTABLE' , py .command .path ),
62+ # find_package(Python2/3) under cmake_minimum_required < 3.15 (CMP0094)
63+ self .define ('Python{}_EXECUTABLE' .format (py .version [0 ]), py .command .path ),
64+ ])
65+
5566 return args
Original file line number Diff line number Diff line change @@ -47,9 +47,15 @@ def cmake_args(self):
4747 args .append (self .define ('USE_PYTHON_3' , int (self .spec ['python' ].version [0 ]) >= 3 ))
4848 args .append (self .define ('USE_PYTHON_2' , int (self .spec ['python' ].version [0 ]) < 3 ))
4949
50+ # Fix cmake taking python3 even if `which python` is python2
51+ py = self .spec ['python' ]
52+ args .extend ([
53+ # find_package(PythonInterp) # Deprecated, but used by pybind11
54+ self .define ('PYTHON_EXECUTABLE' , py .command .path ),
55+ # find_package(Python) under cmake_minimum_required < 3.15 (CMP0094)
56+ self .define ('Python_EXECUTABLE' , py .command .path ),
57+ # find_package(Python2/3) under cmake_minimum_required < 3.15 (CMP0094)
58+ self .define ('Python{}_EXECUTABLE' .format (py .version [0 ]), py .command .path ),
59+ ])
60+
5061 return args
51- # def cmake_args(self):
52- # spec = self.spec
53- # return [
54- # print(spec["libiconv"].libs)
55- # return []
You can’t perform that action at this time.
0 commit comments