Commit 58d2d69
committed
Fix slow
It seems that, even though we give it an exact `Python_ROOT_DIR`,
CMake does still search the system for all other Python versions.
In the end, it does correctly select the one in `Python_ROOT_DIR`
as we specified but the this entire process is very slow: between
20 seconds and a full minute.
The fix is to give CMake more info: tell it which version of Python
is at `Python_ROOT_DIR` and request it to be EXACT. This seems to
allow it to return immediately without considering others. It brings
the time down to ~3 seconds. And if we also tell it the exact
location of `Python_EXECUTABLE`, the time is down to ~1 second.find_package(Python) on Windows1 parent 3f901f0 commit 58d2d69
3 files changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
3 | 7 | | |
4 | 8 | | |
5 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
0 commit comments