tools/cmake: Update to 3.15.1
[openwrt/openwrt.git] / tools / cmake / Makefile
1 #
2 # Copyright (C) 2006-2016 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=cmake
10 PKG_VERSION:=3.15.1
11 PKG_CPE_ID:=cpe:/a:kitware:cmake
12
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14 PKG_SOURCE_URL:=https://github.com/Kitware/CMake/releases/download/v$(PKG_VERSION)/ \
15 https://cmake.org/files/v3.15/
16 PKG_HASH:=18dec548d8f8b04d53c60f9cedcebaa6762f8425339d1e2c889c383d3ccdd7f7
17
18 HOST_BUILD_PARALLEL:=1
19 HOST_CONFIGURE_PARALLEL:=1
20
21 include $(INCLUDE_DIR)/host-build.mk
22
23 # Workaround for GCC versions below 6.X and ccache
24 # Reference: https://github.com/openwrt/openwrt/pull/1929
25 GCC_DMPVER_GREPCMD := grep -E '^(4\.[8-9]|[5]\.?)'
26 GCC_DMPVER_STRING := $(shell $(HOSTCC_NOCACHE) -dumpversion | $(GCC_DMPVER_GREPCMD))
27 ifneq ($(GCC_DMPVER_STRING),)
28 ifeq ($(CONFIG_CCACHE),y)
29 $(info GCC version less than 6.0 detected, disabling CCACHE)
30 HOST_CONFIGURE_VARS:=$(filter-out CC=% gcc%",$(HOST_CONFIGURE_VARS)) CC="$(HOSTCC_NOCACHE)"
31 HOST_CONFIGURE_VARS:=$(filter-out CXX=% g++%",$(HOST_CONFIGURE_VARS)) CXX="$(HOSTCXX_NOCACHE)"
32 else
33 $(info GCC version greater or equal to 6.0 detected, no workaround set for CCACHE)
34 endif
35 endif
36
37 HOST_CONFIGURE_VARS += \
38 MAKEFLAGS="$(HOST_JOBS)" \
39 CXXFLAGS="$(HOST_CFLAGS)"
40
41 HOST_CONFIGURE_ARGS := \
42 $(if $(MAKE_JOBSERVER),--parallel="$(MAKE_JOBSERVER)") \
43 --prefix=$(STAGING_DIR_HOST)
44
45 ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
46 HOST_MAKE_FLAGS += VERBOSE=1
47 endif
48
49 $(eval $(call HostBuild))