Skip to content
This repository was archived by the owner on Feb 4, 2020. It is now read-only.
This repository was archived by the owner on Feb 4, 2020. It is now read-only.

Visual Studio IDE w/ CMake w/ clcache always rebuilds #357

Description

@Cascades

As suggested in #273 and #355 I currently have this for my clcache in cmake in VS:

function(any_target_hook)
set(NON_COMPILE_TARGETS INTERFACE IMPORTED UNKNOWN ALIAS)
  list(FIND NON_COMPILE_TARGETS ${func_ARGV1} found)
  if(${found} GREATER -1)
    return()
  endif()

  set_target_properties(${func_ARGV0} PROPERTIES VS_GLOBAL_CLToolExe ${variable_stoing_my_clcache_executable_name})
  set_target_properties(${func_ARGV0} PROPERTIES VS_GLOBAL_CLToolPath ${variable_stoing_my_clcache_path})
  set_target_properties(${func_ARGV0} PROPERTIES VS_GLOBAL_NoDependency $ENV{CLCACHE_DIR}/stats.txt)
  set_target_properties(${func_ARGV0} PROPERTIES VS_GLOBAL_TrackFileAccess "false")

endfunction()

function(add_library)
  _add_library(${func_ARGN})
  any_target_hook(${func_ARGN})
endfunction()

function(add_executable)
  _add_executable(${ARGN})
  any_target_hook(${ARGN})
endfunction()

I do believe that clcache is working, verified by much faster build times as well as clcache -s showing changes.... however, within Visual Studio (with CMake), every build performs a full clean rebuild, which is faster due to clcache, but really CMake and MSBuild should realise things are up to date before that... and instead of a 3 minute build... i should get a 10 second "everything is up to date"

Any suggestions?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions