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")
15 SET(CMAKE_C_FLAGS "-nostdlib -Wall -Werror \
16 -I${BUILD_DIR_BASE}/include \
17 -I${IDF_PATH}/components/mdns/include \
18 -I${IDF_PATH}/components/driver/include \
19 -I${IDF_PATH}/components/spi_flash/include \
20 -I${IDF_PATH}/components/nvs_flash/include \
21 -I${IDF_PATH}/components/tcpip_adapter/include \
22 -I${IDF_PATH}/components/lwip/include/lwip/posix \
23 -I${IDF_PATH}/components/lwip/include/lwip \
24 -I${IDF_PATH}/components/lwip/include/lwip/port \
25 -I${IDF_PATH}/components/esp32/include/ \
26 -I${IDF_PATH}/components/bootloader_support/include/ \
27 -I${IDF_PATH}/components/app_update/include/ \
28 -I$(IDF_PATH)/components/soc/esp32/include/ \
30 -I${IDF_PATH}/components/nvs_flash/test_nvs_host \
31 -I${IDF_PATH}/components/freertos/include" CACHE STRING "" FORCE)
33 # Where to look for the target environment. (More paths can be added here)
34 set(CMAKE_FIND_ROOT_PATH "${CROSS_PATH}")
36 # Adjust the default behavior of the FIND_XXX() commands:
37 # search programs in the host environment only.
38 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
40 # Search headers and libraries in the target environment only.
41 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
42 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)