Commit efa4628
authored
Assert that the repo directory is named
Our C++ include path assumes that the repo lives in a directory named exactly `executorch`. Users who name it something else run into hard-to-debug issues (see pytorch#6475).
Since we require it, add an explicit check and point users to the issue that tracks the fix.
## Test Plan
Tried generating cmake files under a directory named `executorch` and named `not-executorch`:
```
(rm -rf cmake-out \
&& mkdir cmake-out \
&& cd cmake-out \
&& cmake ../)
```
Note that I added a trailing slash just in case CMAKE_CURRENT_SOURCE_DIR included that slash and might confuse `cmake_path()`. (note that CMAKE_CURRENT_SOURCE_DIR does not include the trailing slash in this case)
This command succeeded when the directory is named `executorch`.
Under `not-executorch` it failed with the error:
```
CMake Error at CMakeLists.txt:332 (message):
The ExecuTorch repo must be cloned into a directory named exactly
`executorch`; found `not-executorch`. See
pytorch#6475 for progress on a fix for
this restriction.
```
Also tested with the instructions at [pytorch.org/executorch/main/llm/getting-started.html](https://pytorch.org/executorch/main/llm/getting-started.html), where executorch is a sub-repo of the top project. It builds when following the directions, but if I rename the repo to third-party/not-executorch then I see the expected error.executorch (pytorch#6480)1 parent 7b03a8b commit efa4628
1 file changed
+13
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
327 | 340 | | |
328 | 341 | | |
329 | 342 | | |
| |||
0 commit comments