Skip to content

Commit 946f513

Browse files
make: tweak setup target (#2289)
Use cmake `--fresh` if available (so the cache is ignored).
1 parent 9603653 commit 946f513

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Makefile.defs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ endif
4949
LINUX_ARCH?=native
5050

5151
CMAKE := cmake -Wdev --warn-uninitialized
52+
CMAKE_VERSION := $(word 3,$(shell cmake --version))
53+
USING_CMAKE_3_24_OR_BETTER := $(call at_least_version,$(CMAKE_VERSION),3.24.0)
54+
5255
NINJA := $(or $(NINJA),ninja)
5356

5457
NINJA_VERSION := $(shell $(NINJA) --version)
@@ -106,7 +109,7 @@ ifeq (0,$(MAKELEVEL))
106109
export NINJAFLAGS
107110
endif
108111

109-
CMAKE_FLAGS = -G Ninja
112+
CMAKE_FLAGS = $(if $(USING_CMAKE_3_24_OR_BETTER),--fresh) -G Ninja
110113

111114
# set this to your ARM cross compiler:
112115
# set CC CXX AR LD RANLIB

0 commit comments

Comments
 (0)