This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 3525de5c548 tasking: merge get_tasking_ctc_root function
3525de5c548 is described below

commit 3525de5c54803c37f03134d5d45c951165a043ce
Author: zhangyuan29 <[email protected]>
AuthorDate: Wed Nov 19 18:05:43 2025 +0800

    tasking: merge get_tasking_ctc_root function
    
    get_smartcode_ctc_root function will return fail
    before toolchain path set. so delete error message
    and merge the same feature to one function.
    
    Signed-off-by: zhangyuan29 <[email protected]>
---
 arch/tricore/src/cmake/tasking.cmake | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/arch/tricore/src/cmake/tasking.cmake 
b/arch/tricore/src/cmake/tasking.cmake
index 9f19b8c5c12..63b73077515 100644
--- a/arch/tricore/src/cmake/tasking.cmake
+++ b/arch/tricore/src/cmake/tasking.cmake
@@ -122,20 +122,24 @@ add_compile_options(
   $<$<COMPILE_LANGUAGE:CXX>:--language=+gcc,+volatile,-strings,-kanji>)
 add_compile_options(--pass-c++=-D__CTC__)
 
-function(get_smartcode_ctc_root OUT_VAR)
+function(get_tasking_ctc_root OUT_VAR)
+  set(${OUT_VAR} "")
   find_program(_CCTC_PATH cctc)
-  if(NOT _CCTC_PATH)
-    message(FATAL_ERROR "get_smartcode_ctc_root: cannot find 'cctc' in PATH")
+  if(_CCTC_PATH)
+    get_filename_component(_BIN_DIR "${_CCTC_PATH}" DIRECTORY)
+    get_filename_component(_ROOT_DIR "${_BIN_DIR}" DIRECTORY)
+    set(${OUT_VAR}
+        "${_ROOT_DIR}"
+        PARENT_SCOPE)
   endif()
-  get_filename_component(_BIN_DIR "${_CCTC_PATH}" DIRECTORY)
-  get_filename_component(_ROOT_DIR "${_BIN_DIR}" DIRECTORY)
-  set(${OUT_VAR}
-      "${_ROOT_DIR}"
-      PARENT_SCOPE)
 endfunction()
 
-get_smartcode_ctc_root(SMARTCODE_CTC_ROOT)
-add_compile_options(-I${SMARTCODE_CTC_ROOT}/include)
+get_tasking_ctc_root(TASKING_ROOT_PATH)
+# search limits.h in this path firstly under include.cxx/support/tasking
+if(TASKING_ROOT_PATH)
+  add_compile_options(-I${TASKING_ROOT_PATH}/include.cxx/support/tasking)
+  add_compile_options(-I${TASKING_ROOT_PATH}/include)
+endif()
 
 if(CONFIG_DEBUG_CUSTOMOPT)
   add_compile_options(${CONFIG_DEBUG_OPTLEVEL})
@@ -252,15 +256,11 @@ endif()
 
 set(NUTTX_FIND_TOOLCHAIN_LIB_DEFINED true)
 function(nuttx_find_toolchain_lib)
-  get_filename_component(TASKING_ROOT_PATH "${CMAKE_C_COMPILER}" DIRECTORY)
-  string(REGEX REPLACE "^/([a-zA-Z])/(.*)$" "\\1:/\\2" TASKING_ROOT_TEMP_PATH
-                       "${TASKING_ROOT_PATH}")
-  string(STRIP "${TASKING_ROOT_TEMP_PATH}" TASKING_ROOT_PATH)
-  if(ARGN)
+  if(TASKING_ROOT_PATH AND ARGN)
     if(CONFIG_ARCH_CHIP_TC3XX)
-      nuttx_add_extra_library(${TASKING_ROOT_PATH}/../lib/tc162/${ARGN})
+      nuttx_add_extra_library(${TASKING_ROOT_PATH}/lib/tc162/${ARGN})
     elseif(CONFIG_ARCH_CHIP_TC4XX)
-      nuttx_add_extra_library(${TASKING_ROOT_PATH}/../lib/tc18/${ARGN})
+      nuttx_add_extra_library(${TASKING_ROOT_PATH}/lib/tc18/${ARGN})
     endif()
   endif()
 endfunction()

Reply via email to