Merge pull request #1436 from karl-lunarg/karl-ccache
authorJohn Kessenich <johnkslang@users.noreply.github.com>
Thu, 19 Jul 2018 03:39:31 +0000 (20:39 -0700)
committerGitHub <noreply@github.com>
Thu, 19 Jul 2018 03:39:31 +0000 (20:39 -0700)
build: Add ccache option to CMake config

1  2 
CMakeLists.txt

diff --combined CMakeLists.txt
@@@ -21,7 -21,6 +21,7 @@@ option(SKIP_GLSLANG_INSTALL "Skip insta
  if(NOT ${SKIP_GLSLANG_INSTALL})
    set(ENABLE_GLSLANG_INSTALL ON)
  endif()
 +option(ENABLE_SPVREMAPPER "Enables building of SPVRemapper" ON)
  
  option(ENABLE_AMD_EXTENSIONS "Enables support of AMD-specific extensions" ON)
  option(ENABLE_GLSLANG_BINARIES "Builds glslangValidator and spirv-remap" ON)
@@@ -36,6 -35,14 +36,14 @@@ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_
      set(CMAKE_INSTALL_PREFIX "install" CACHE STRING "..." FORCE)
  endif()
  
+ option(USE_CCACHE "Use ccache" OFF)
+ if(USE_CCACHE)
+     find_program(CCACHE_FOUND ccache)
+     if(CCACHE_FOUND)
+         set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
+     endif(CCACHE_FOUND)
+ endif()
  project(glslang)
  # make testing optional
  include(CTest)
@@@ -53,7 -60,7 +61,7 @@@ if(ENABLE_HLSL
  endif(ENABLE_HLSL)
  
  if(WIN32)
 -    set(CMAKE_DEBUG_POSTFIX "d")
 +    set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Adds a postfix for debug-built libraries.")
      if(MSVC)
          include(ChooseMSVCCRT.cmake)
      endif(MSVC)