hintonda created this revision. hintonda added reviewers: beanz, mclow.lists. hintonda added a subscriber: cfe-commits.
A common error for new users it to checkout subprojects, like clang or clang-tools-extra, into the wrong subdirectory. This change helps prevent this, since the resulting build would otherwise be unusable. http://reviews.llvm.org/D16964 Files: projects/CMakeLists.txt Index: projects/CMakeLists.txt =================================================================== --- projects/CMakeLists.txt +++ projects/CMakeLists.txt @@ -4,6 +4,14 @@ file(GLOB entries *) foreach(entry ${entries}) if(IS_DIRECTORY ${entry} AND EXISTS ${entry}/CMakeLists.txt) + # Do not allow tools like clang or clang-tools-extra in the projects directory + if(${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/clang) + message(FATAL_ERROR "clang must be placed under llvm/tools, not llvm/projects") + endif() + if((${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/extra) OR + (${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/clang-tools-extra)) + message(FATAL_ERROR "clang-tools-extra (extra) must be placed under llvm/tools/clang/tools, not llvm/projects") + endif() if((NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/compiler-rt) AND (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/dragonegg) AND (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libcxx) AND
Index: projects/CMakeLists.txt =================================================================== --- projects/CMakeLists.txt +++ projects/CMakeLists.txt @@ -4,6 +4,14 @@ file(GLOB entries *) foreach(entry ${entries}) if(IS_DIRECTORY ${entry} AND EXISTS ${entry}/CMakeLists.txt) + # Do not allow tools like clang or clang-tools-extra in the projects directory + if(${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/clang) + message(FATAL_ERROR "clang must be placed under llvm/tools, not llvm/projects") + endif() + if((${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/extra) OR + (${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/clang-tools-extra)) + message(FATAL_ERROR "clang-tools-extra (extra) must be placed under llvm/tools/clang/tools, not llvm/projects") + endif() if((NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/compiler-rt) AND (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/dragonegg) AND (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libcxx) AND
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits