Skip to content

Commit

Permalink
cmake: fix external projects cmake bug (#1986)
Browse files Browse the repository at this point in the history
Work around cmake bug https://gitlab.kitware.com/cmake/cmake/-/issues/25428
(introduced in 3.23.0, fixed in 3.27.9): do not create `build.d` dependency
files with phony targets (which would keep triggering unnecessary rebuilds
of some external projects).
  • Loading branch information
benoit-pierre authored Nov 23, 2024
1 parent df64292 commit 36ddc95
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion thirdparty/cmake_modules/koenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ generate_depfile() { (
srclist="$3"
shift 3
exec 1>"${depfile}" || return 1
printf '%s: \\\n' "${target}"
# NOTE: to work around cmake bug https://gitlab.kitware.com/cmake/cmake/-/issues/25428
# (introduced in 3.23.0, fixed in 3.27.9), do not create a target with no deps (which
# would keep triggering unnecessary rebuilds).
printf '%s: %s \\\n' "${target}" "${srclist}"
sed '/\/$/d;/[~()=]/d;s/[[:space:]\\]/\\&/g;s/\$/$$/g;$!{s/$/ \\/;}' "${srclist}"
); }

Expand Down

0 comments on commit 36ddc95

Please sign in to comment.