Tasking Toolchain: How to properly use it?

Hi Manuel,

the bare minimum toolchain would look like this (exactly like for others):

set(CMAKE_SYSTEM_NAME Generic-ELF)
set(CMAKE_TASKING_TOOLSET SmartCode)
set(CMAKE_CXX_STANDARD_LIBRARIES "-lc -lcpx -lstlx --munch")

# Find Tasking for Tricore.
find_program(TRICORE_COMPILER_C cctc PATHS ENV TASKING_TRICORE_TOOLCHAIN_PATH PATH_SUFFIXES bin)

# Specify the cross compiler
set(CMAKE_C_COMPILER ${TRICORE_COMPILER_C})
set(CMAKE_CXX_COMPILER ${TRICORE_COMPILER_C})
set(CMAKE_ASM_COMPILER ${TRICORE_COMPILER_C})

The CMAKE_CXX_STANDARD_LIBRARIES is not 100% necessary for CXX and it also depends on the execption support and float type. You can add it also via target_link_libraries.

See the following attached toolchain file for additional stuff:
TaskingTricoreTC4.cmake (2.1 KB)
Additionally you can add to the file something like:

add_compile_options(
    -Ctc49x --language=+volatile --no-exceptions --anachronisms  -N0 -Z0 -Y0
)
add_link_options(
    LINKER:--optimize=2
    -d${PROJECT_SOURCE_DIR}/Lcf_Tasking_Tricore_Tc.lsl
)

If you want to have default options for your project.

BR,
go2sh

1 Like