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