package-cmake: remove now-redundant target ccache support
authorArnout Vandecappelle <arnout@mind.be>
Sun, 4 Oct 2015 12:28:53 +0000 (13:28 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Sun, 4 Oct 2015 16:22:20 +0000 (18:22 +0200)
All the complexity with the different ways that CMAKE_C_COMPILER and
CMAKE_C_COMPILER_ARG1 can be set are no longer needed, it's all handled
by the toolchain wrapper now.

Note that it is still necessary to handle this for the host build.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Romain Naour <romain.naour@openwide.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/pkg-cmake.mk
support/misc/toolchainfile.cmake.in

index 6bc13d4a92f6287f0ddb7c5ab580a1c123256e8a..81dcfcce1695a7b6216a55ac5fd8478efccace40 100644 (file)
@@ -98,7 +98,6 @@ define $(2)_CONFIGURE_CMDS
                -DBUILD_TESTS=OFF \
                -DBUILD_TESTING=OFF \
                -DBUILD_SHARED_LIBS=$$(if $$(BR2_STATIC_LIBS),OFF,ON) \
-               -DUSE_CCACHE=$$(if $$(BR2_CCACHE),ON,OFF) \
                $$(CMAKE_QUIET) \
                $$($$(PKG)_CONF_OPTS) \
        )
@@ -245,8 +244,8 @@ $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
                -e 's#@@TARGET_CFLAGS@@#$(call qstrip,$(TARGET_CFLAGS))#' \
                -e 's#@@TARGET_CXXFLAGS@@#$(call qstrip,$(TARGET_CXXFLAGS))#' \
                -e 's#@@TARGET_LDFLAGS@@#$(call qstrip,$(TARGET_LDFLAGS))#' \
-               -e 's#@@TARGET_CC_NOCCACHE@@#$(subst $(HOST_DIR)/,,$(call qstrip,$(TARGET_CC_NOCCACHE)))#' \
-               -e 's#@@TARGET_CXX_NOCCACHE@@#$(subst $(HOST_DIR)/,,$(call qstrip,$(TARGET_CXX_NOCCACHE)))#' \
+               -e 's#@@TARGET_CC@@#$(subst $(HOST_DIR)/,,$(call qstrip,$(TARGET_CC)))#' \
+               -e 's#@@TARGET_CXX@@#$(subst $(HOST_DIR)/,,$(call qstrip,$(TARGET_CXX)))#' \
                -e 's#@@CMAKE_SYSTEM_PROCESSOR@@#$(call qstrip,$(CMAKE_SYSTEM_PROCESSOR))#' \
                $(TOPDIR)/support/misc/toolchainfile.cmake.in \
                > $@
index cd412542e5e81a9868744df9d30fc0e5f607a0b0..5cf381e96c667dd9e1af8bfd87d2c15af351948d 100644 (file)
@@ -27,33 +27,5 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
 set(ENV{PKG_CONFIG_SYSROOT_DIR} "${RELOCATED_HOST_DIR}/@@STAGING_SUBDIR@@")
 
 # This toolchain file can be used both inside and outside Buildroot.
-# * When used inside Buildroot, ccache support is explicitly driven using the
-#   USE_CCACHE variable.
-# * When used outside Buildroot (i.e. when USE_CCACHE is not defined), ccache
-#   support is automatically enabled if the ccache program is available.
-if(DEFINED USE_CCACHE)
-       if(USE_CCACHE)
-               set(CMAKE_ASM_COMPILER "${RELOCATED_HOST_DIR}/@@TARGET_CC_NOCCACHE@@")
-               set(CMAKE_C_COMPILER "${RELOCATED_HOST_DIR}/usr/bin/ccache")
-               set(CMAKE_CXX_COMPILER "${RELOCATED_HOST_DIR}/usr/bin/ccache")
-               set(CMAKE_C_COMPILER_ARG1 "${RELOCATED_HOST_DIR}/@@TARGET_CC_NOCCACHE@@")
-               set(CMAKE_CXX_COMPILER_ARG1 "${RELOCATED_HOST_DIR}/@@TARGET_CXX_NOCCACHE@@")
-       else()
-               set(CMAKE_C_COMPILER "${RELOCATED_HOST_DIR}/@@TARGET_CC_NOCCACHE@@")
-               set(CMAKE_CXX_COMPILER "${RELOCATED_HOST_DIR}/@@TARGET_CXX_NOCCACHE@@")
-       endif()
-else()
-       find_program(CCACHE ccache HINTS "${RELOCATED_HOST_DIR}/usr/bin")
-       if(CCACHE)
-               set(CMAKE_ASM_COMPILER "${RELOCATED_HOST_DIR}/@@TARGET_CC_NOCCACHE@@")
-               set(CMAKE_C_COMPILER "${CCACHE}")
-               set(CMAKE_CXX_COMPILER "${CCACHE}")
-               set(CMAKE_C_COMPILER_ARG1 "${RELOCATED_HOST_DIR}/@@TARGET_CC_NOCCACHE@@")
-               set(CMAKE_CXX_COMPILER_ARG1 "${RELOCATED_HOST_DIR}/@@TARGET_CXX_NOCCACHE@@")
-               message(STATUS "ccache program has been found and will be used for the build.")
-               message(STATUS "  To disable ccache, add -DUSE_CCACHE=OFF on the cmake command line.")
-       else()
-               set(CMAKE_C_COMPILER "${RELOCATED_HOST_DIR}/@@TARGET_CC_NOCCACHE@@")
-               set(CMAKE_CXX_COMPILER "${RELOCATED_HOST_DIR}/@@TARGET_CXX_NOCCACHE@@")
-       endif()
-endif()
+set(CMAKE_C_COMPILER "${RELOCATED_HOST_DIR}/@@TARGET_CC@@")
+set(CMAKE_CXX_COMPILER "${RELOCATED_HOST_DIR}/@@TARGET_CXX@@")