# Tasking Toolchain: How to properly use it?

**URL:** <https://discourse.cmake.org/t/tasking-toolchain-how-to-properly-use-it/7615>\
**Category:** Usage\
**Tags:** os:linux, os:windows\
**Created:** [March 7, 2023, 11:36am UTC](https://discourse.cmake.org/t/tasking-toolchain-how-to-properly-use-it/7615 "2023-03-07T11:36:01Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![go2sh](https://discourse.cmake.org/user_avatar/discourse.cmake.org/go2sh/32/2606_2.png) [@go2sh](https://discourse.cmake.org/u/go2sh)\
**Post date:** [March 9, 2023, 11:57pm UTC](https://discourse.cmake.org/t/tasking-toolchain-how-to-properly-use-it/7615/6 "2023-03-09T23:57:02Z")

</div>

Hi Manuel,

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

```auto
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](https://discourse.cmake.org/uploads/short-url/lYUbdeZhvUcHUOQReI1FHgKvSWa.cmake) (2.1 KB)  
Additionally you can add to the file something like:

```auto
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

---

_[View the full topic](https://discourse.cmake.org/t/tasking-toolchain-how-to-properly-use-it/7615)._
