From dace8b72e3a8173704a689a7074df4c6f36bda4a Mon Sep 17 00:00:00 2001 From: haohao Date: Sat, 19 Feb 2022 03:56:30 +0800 Subject: [PATCH] update (#10306) --- cmake/modules/Arduino.cmake | 2 +- cmake/modules/Hexagon.cmake | 2 +- cmake/modules/RustExt.cmake | 4 ++-- cmake/modules/StandaloneCrt.cmake | 8 ++++---- cmake/modules/Zephyr.cmake | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmake/modules/Arduino.cmake b/cmake/modules/Arduino.cmake index 54c144081efa..f603e5d5df2b 100644 --- a/cmake/modules/Arduino.cmake +++ b/cmake/modules/Arduino.cmake @@ -43,7 +43,7 @@ if(USE_MICRO) math(EXPR job_spec_stop "${job_spec_length} - 3") list(GET job_spec 0 job_src_base) - set(job_src_base "${CMAKE_SOURCE_DIR}/${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") diff --git a/cmake/modules/Hexagon.cmake b/cmake/modules/Hexagon.cmake index 08faf2973529..d1e62358a2d9 100644 --- a/cmake/modules/Hexagon.cmake +++ b/cmake/modules/Hexagon.cmake @@ -54,7 +54,7 @@ macro(file_glob_append _output_list) set(${_output_list} ${_tmp1}) endmacro() -set(TVMRT_SOURCE_DIR "${CMAKE_SOURCE_DIR}/src/runtime") +set(TVMRT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/runtime") # First, verify that USE_HEXAGON_DEVICE has a valid value. if(DEFINED USE_HEXAGON_DEVICE) diff --git a/cmake/modules/RustExt.cmake b/cmake/modules/RustExt.cmake index 2922bc48dee2..e30caf0a0b04 100644 --- a/cmake/modules/RustExt.cmake +++ b/cmake/modules/RustExt.cmake @@ -16,8 +16,8 @@ # under the License. if(USE_RUST_EXT) - set(RUST_SRC_DIR "${CMAKE_SOURCE_DIR}/rust") - set(CARGO_OUT_DIR "${CMAKE_SOURCE_DIR}/rust/target") + set(RUST_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/rust") + set(CARGO_OUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/rust/target") if(USE_RUST_EXT STREQUAL "STATIC") set(COMPILER_EXT_PATH "${CARGO_OUT_DIR}/release/libcompiler_ext.a") diff --git a/cmake/modules/StandaloneCrt.cmake b/cmake/modules/StandaloneCrt.cmake index e63521e26dbf..c6e6dc77b442 100644 --- a/cmake/modules/StandaloneCrt.cmake +++ b/cmake/modules/StandaloneCrt.cmake @@ -57,7 +57,7 @@ if(USE_MICRO) math(EXPR job_spec_stop "${job_spec_length} - 3") list(GET job_spec 0 job_src_base) - set(job_src_base "${CMAKE_SOURCE_DIR}/${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") @@ -93,7 +93,7 @@ if(USE_MICRO) endforeach() set(make_common_args - "CRT_CONFIG=${CMAKE_SOURCE_DIR}/src/runtime/micro/crt_config.h" + "CRT_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/src/runtime/micro/crt_config.h" "BUILD_DIR=${host_build_dir_abspath}" "EXTRA_CFLAGS=-fPIC" "EXTRA_CXXFLAGS=-fPIC" @@ -124,9 +124,9 @@ if(USE_MICRO) # Create the `crttest` target if we can find GTest. If not, we create dummy # targets that give the user an informative error message. if(GTEST_FOUND) - tvm_file_glob(GLOB TEST_SRCS ${CMAKE_SOURCE_DIR}/tests/crt/*.cc) + tvm_file_glob(GLOB TEST_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/tests/crt/*.cc) add_executable(crttest ${TEST_SRCS}) - target_include_directories(crttest SYSTEM PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/standalone_crt/include ${CMAKE_SOURCE_DIR}/src/runtime/micro) + target_include_directories(crttest SYSTEM PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/standalone_crt/include ${CMAKE_CURRENT_SOURCE_DIR}/src/runtime/micro) target_link_libraries(crttest PRIVATE ${cmake_crt_libraries} GTest::GTest GTest::Main pthread dl) set_target_properties(crttest PROPERTIES EXCLUDE_FROM_ALL 1) set_target_properties(crttest PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 1) diff --git a/cmake/modules/Zephyr.cmake b/cmake/modules/Zephyr.cmake index 048240375cd6..a1cafce29d6e 100644 --- a/cmake/modules/Zephyr.cmake +++ b/cmake/modules/Zephyr.cmake @@ -43,7 +43,7 @@ if(USE_MICRO) math(EXPR job_spec_stop "${job_spec_length} - 3") list(GET job_spec 0 job_src_base) - set(job_src_base "${CMAKE_SOURCE_DIR}/${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")