zhuhan0 added inline comments.
================ Comment at: llvm/cmake/modules/GenerateVersionFromVCS.cmake:50 + endif() + append_info(${name} "${${name}_SOURCE_DIR}" "" "") endif() ---------------- drodriguez wrote: > I would recommend changing the flow a little bit: > > - Remove `path` argument from `append_info`. Leave `name`, `revision`, and > `repository`. > - Remove the `if(path) get_source_info() endif()` part. > - Change this `foreach` to the following: > > ``` > foreach(name IN LISTS NAMES) > if(${name}_VC_REPOSITORY AND ${name}_VC_REVISION) > set(revision ${${name}_VC_REVISION}) > set(repository ${${name}_VC_REPOSITORY}) > elseif(DEFINED ${name}_SOURCE_DIR) > get_source_info(${${name}_SOURCE_DIR} revision repository) > else() > message(FATAL_ERROR "${name}_SOURCE_DIR is not defined") > endif() > append_info(${name} ${revision} ${repository}) > endforeach() > ``` Looks much better! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148262/new/ https://reviews.llvm.org/D148262 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits