# How do I link amazon freertos to my project

**URL:** <https://forums.freertos.org/t/how-do-i-link-amazon-freertos-to-my-project/13210>\
**Category:** Cypress\
**Created:** [August 11, 2021, 7:54am UTC](https://forums.freertos.org/t/how-do-i-link-amazon-freertos-to-my-project/13210 "2021-08-11T07:54:16Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![senfrost](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@senfrost](https://forums.freertos.org/u/senfrost)\
**Post date:** [August 13, 2021, 9:04am UTC](https://forums.freertos.org/t/how-do-i-link-amazon-freertos-to-my-project/13210/7 "2021-08-13T09:04:30Z")

</div>

Hi @gedeonag  
I this is my current CMakelists.txt

```auto
cmake_minimum_required(VERSION 3.13)

project(my_app)

add_executable(${PROJECT_NAME} src/main.c)

set(IDF_PROJECT_EXECUTABLE ${PROJECT_NAME})

# Add FreeRTOS as a subdirectory. AFR_BOARD tells which board to target.
set(AFR_BOARD cypress.CY8CKIT_064S0S2_4343W CACHE INTERNAL "")
set(AFR_TOOLCHAIN arm-gcc CACHE INTERNAL "")

add_subdirectory(freertos)

# Link against the mqtt library so that we can use it. Dependencies are transitively
# linked.
target_link_libraries(${PROJECT_NAME} PRIVATE 
                        AFR::freertos 
                        AFR::kernel 
                        AFR::core_http 
                        AFR::core_json
                        AFR::secure_sockets
                        AFR::ble
                        AFR::wifi
                        )

```

but when I run `cmake -S . -B .\build -G "MinGW Makefiles"` it uses my mingw gcc compiler and not my arm-none-eabi-gcc compiler but when I build freertos using `cmake -DVENDOR=cypress -DBOARD=CY8CKIT_064S0S2_4343W -DCOMPILER=arm-gcc -S .\freertos\ -B .\build\ -G "MinGW Makefiles"` it does use my arm-none-eabi-gcc compiler.  
any ideas of how I can fix this?

---

_[View the full topic](https://forums.freertos.org/t/how-do-i-link-amazon-freertos-to-my-project/13210)._
