Commit 078ed37
authored
build: resolve cmake executable at configuration time (#319)
* build: resolve cmake executable at configuration time
GUI-launched IDEs on macOS don't inherit Homebrew's /opt/homebrew/bin PATH,
so the configure/compile Exec tasks invoking `commandLine("cmake", ...)`
can fail with "Cannot run program 'cmake'" even when cmake is installed.
Resolve an absolute cmake path at configuration time via CmakeDetection:
check $CMAKE env var, scan $PATH, then fall back to common install paths
for macOS/Linux/Windows.
* build: require isFile in cmake detection and normalize to absolute path
Address Copilot review nits on #319:
- `File.canExecute()` alone returns true for directories with +x on POSIX,
so a directory named `cmake` under a PATH entry (or in common install
locations) could be incorrectly selected. Require `isFile && canExecute()`.
- A relative `$CMAKE` value (e.g. `./cmake-wrapper`) was returned as-is,
contradicting the "absolute path" KDoc. Normalize all detected candidates
via `absolutePath`.1 parent 56f912d commit 078ed37
2 files changed
Lines changed: 51 additions & 2 deletions
File tree
- buildSrc/src/main/kotlin
- org/jetbrains/kotlinx/multik/builds
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | | - | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| |||
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
49 | | - | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
0 commit comments