clean: fixes for appveyor warnings
[platform/upstream/libwebsockets.git] / cross-esp32.cmake
1 #
2 # CMake Toolchain file for crosscompiling on ARM.
3 #
4 # This can be used when running cmake in the following way:
5 #  cd build/
6 #  cmake .. -DCMAKE_TOOLCHAIN_FILE=../cross-arm-linux-gnueabihf.cmake
7 #
8
9 # Target operating system name.
10 set(CMAKE_SYSTEM_NAME Linux)
11
12 # Name of C compiler.
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")
17
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/ \
32         ${LWS_C_FLAGS} -Os \
33         -I${IDF_PATH}/components/nvs_flash/test_nvs_host \
34         -I${IDF_PATH}/components/freertos/include" CACHE STRING "" FORCE)
35
36 # Where to look for the target environment. (More paths can be added here)
37 set(CMAKE_FIND_ROOT_PATH "${CROSS_PATH}")
38
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)
42
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)
46