llvm.org GIT mirror llvm / 5bd68ee
[CMake] We shouldn't be storing values in the cache unless they actually need CMake cache behavior. add_llvm_external_project puts LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR into the cache even if it is just the in-tree default path. This causes all sorts of oddness, and makes it so that I can't change the behavior of this variable. This patch never puts LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR into the cache. It will only end up in the cache if it is specified on the command line, which is the correct behavior. There is also a temporary change to remove non-default values from the cache if they are already present. This should have the impact of cleaning out unncecissary values from the caches on the buildbots and people's local build directories. This part of the change is marked with a TODO and can be removed in a few days. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242102 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Bieneman 4 years ago
1 changed file(s) with 9 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
688688 list(APPEND LLVM_IMPLICIT_PROJECT_IGNORE "${CMAKE_CURRENT_SOURCE_DIR}/${add_llvm_external_dir}")
689689 string(REPLACE "-" "_" nameUNDERSCORE ${name})
690690 string(TOUPPER ${nameUNDERSCORE} nameUPPER)
691 set(LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${add_llvm_external_dir}"
692 CACHE PATH "Path to ${name} source directory")
693 if (NOT ${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR} STREQUAL ""
694 AND EXISTS ${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR}/CMakeLists.txt)
691 #TODO: Remove this check in a few days once it has circulated through
692 # buildbots and people's checkouts (cbieneman - July 14, 2015)
693 if(${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR} STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/${add_llvm_external_dir}")
694 unset(LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR CACHE)
695 endif()
696 if(NOT LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR)
697 set(LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${add_llvm_external_dir}")
698 endif()
699 if (EXISTS ${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR}/CMakeLists.txt)
695700 option(LLVM_EXTERNAL_${nameUPPER}_BUILD
696701 "Whether to build ${name} as part of LLVM" ON)
697702 if (LLVM_EXTERNAL_${nameUPPER}_BUILD)