alanmacd commented on code in PR #13600:
URL: https://github.com/apache/tvm/pull/13600#discussion_r1046432873


##########
cmake/modules/StandaloneCrt.cmake:
##########
@@ -40,129 +40,143 @@ if(MSVC)
 
 else()
 
-  message(STATUS "Build standalone CRT for microTVM")
-
-  function(tvm_crt_define_targets)
-    # Build an isolated build directory, separate from the TVM tree.
-    list(APPEND CRT_FILE_COPY_JOBS
-         "3rdparty/libcrc/include *.h -> include"
-         "3rdparty/libcrc/src crcccitt.c -> 
src/runtime/crt/microtvm_rpc_common"
-         "3rdparty/libcrc/tab gentab_ccitt.inc -> src/runtime/crt/tab"
-         "3rdparty/dlpack/include *.h -> include"
-         "3rdparty/dmlc-core/include *.h -> include"
-         "include/tvm/runtime c_*_api.h -> include/tvm/runtime"
-         "include/tvm/runtime metadata_types.h -> include/tvm/runtime"
-         "include/tvm/runtime/crt *.h -> include/tvm/runtime/crt"
-         "src/runtime/crt Makefile -> ."
-         "src/runtime/crt/include *.h -> include"
-         "src/runtime/crt/aot_executor *.c -> src/runtime/crt/aot_executor"
-         "src/runtime/crt/aot_executor_module *.c -> 
src/runtime/crt/aot_executor_module"
-         "src/runtime/crt/common *.c -> src/runtime/crt/common"
-         "src/runtime/crt/graph_executor *.c -> src/runtime/crt/graph_executor"
-         "src/runtime/crt/graph_executor_module *.c -> 
src/runtime/crt/graph_executor_module"
-         "src/runtime/crt/host *.cc -> template/host"
-         "src/runtime/crt/host *.py -> template/host"
-         "src/runtime/crt/host Makefile.template -> template/host"
-         "src/runtime/crt/memory *.c -> src/runtime/crt/memory"
-         "src/runtime/crt/microtvm_rpc_common *.cc -> 
src/runtime/crt/microtvm_rpc_common"
-         "src/runtime/crt/microtvm_rpc_server *.cc -> 
src/runtime/crt/microtvm_rpc_server"
-         "src/runtime/minrpc *.h -> src/runtime/minrpc"
-         "src/support generic_arena.h -> src/support"
-         "src/support ssize.h -> src/support"
-         "src/runtime/crt crt_config-template.h -> template"
-         )
-
-    set(standalone_crt_base "${CMAKE_CURRENT_BINARY_DIR}/standalone_crt")
-
-    foreach(job_spec IN LISTS CRT_FILE_COPY_JOBS)
-      string(REPLACE " " ";" job_spec "${job_spec}")
-      list(LENGTH job_spec job_spec_length)
-      math(EXPR job_spec_length_mod "${job_spec_length} % 3")
-      if(NOT "${job_spec_length_mod}" EQUAL 1)
-        message(FATAL_ERROR "CRT copy job spec list length is 
${job_spec_length}; parsed job spec is ${job_spec}")
-      endif()
-      math(EXPR job_spec_stop "${job_spec_length} - 3")
-
-      list(GET job_spec 0 job_src_base)
-      set(job_src_base "${CMAKE_CURRENT_SOURCE_DIR}/${job_src_base}")
-      foreach(copy_pattern_index RANGE 1 "${job_spec_stop}" 3)
-        list(GET job_spec ${copy_pattern_index} copy_pattern)
-        math(EXPR copy_dest_index "${copy_pattern_index} + 2")
-        list(GET job_spec ${copy_dest_index} copy_dest)
-
-        tvm_file_glob(GLOB_RECURSE copy_files
-             RELATIVE "${job_src_base}"
-             "${job_src_base}/${copy_pattern}")
-        list(LENGTH copy_files copy_files_length)
-        if("${copy_files_length}" EQUAL 0)
-          message(FATAL_ERROR "CRT copy job matched 0 files: 
${job_src_base}/${copy_pattern} -> ${copy_dest}")
-        endif()
-        foreach(copy_src IN LISTS copy_files)
-          get_filename_component(dest_path 
"${standalone_crt_base}/${copy_dest}/${copy_src}" ABSOLUTE)
-          tvm_micro_add_copy_file(host_isolated_build_deps 
${job_src_base}/${copy_src} ${dest_path})
-        endforeach()
-      endforeach()
+  function(create_crt_library CRT_LIBRARY_NAME)
+    set(cmake_crt_lib_name host_standalone_crt_${CRT_LIBRARY_NAME})

Review Comment:
   uppercase



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to