2 # CMake Toolchain file for crosscompiling on ARM.
4 # This can be used when running cmake in the following way:
6 # cmake .. -DCMAKE_TOOLCHAIN_FILE=../cross-arm-linux-gnueabihf.cmake
9 # Target operating system name.
10 set(CMAKE_SYSTEM_NAME Linux)
13 set(CMAKE_C_COMPILER "${CROSS_PATH}/bin/xtensa-esp32-elf-gcc")
14 set(CMAKE_AR "${CROSS_PATH}/bin/xtensa-esp32-elf-ar")
15 set(CMAKE_RANLIB "${CROSS_PATH}/bin/xtensa-esp32-elf-ranlib")
16 set(CMAKE_LINKER "${CROSS_PATH}/bin/xtensa-esp32-elf-ld")
18 SET(CMAKE_C_FLAGS "-nostdlib -Wall -Werror \
19 -I${BUILD_DIR_BASE}/include \
20 -I${IDF_PATH}/components/mdns/include \
21 -I${IDF_PATH}/components/driver/include \
22 -I${IDF_PATH}/components/spi_flash/include \
23 -I${IDF_PATH}/components/nvs_flash/include \
24 -I${IDF_PATH}/components/tcpip_adapter/include \
25 -I${IDF_PATH}/components/lwip/include/lwip/posix \
26 -I${IDF_PATH}/components/lwip/include/lwip \
27 -I${IDF_PATH}/components/lwip/include/lwip/port \
28 -I${IDF_PATH}/components/esp32/include/ \
29 -I${IDF_PATH}/components/bootloader_support/include/ \
30 -I${IDF_PATH}/components/app_update/include/ \
31 -I$(IDF_PATH)/components/soc/esp32/include/ \
33 -I${IDF_PATH}/components/nvs_flash/test_nvs_host \
34 -I${IDF_PATH}/components/freertos/include" CACHE STRING "" FORCE)
36 # Where to look for the target environment. (More paths can be added here)
37 set(CMAKE_FIND_ROOT_PATH "${CROSS_PATH}")
39 # Adjust the default behavior of the FIND_XXX() commands:
40 # search programs in the host environment only.
41 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
43 # Search headers and libraries in the target environment only.
44 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
45 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)