1# the name of the target operating system
2set(CMAKE_SYSTEM_NAME Generic)
3
4set(CMAKE_SYSTEM_PROCESSOR arm)
5
6# which compilers to use for C
7set(TARGET_COMPILE_OPTIONS -m32 -target thumbv6m-none-eabi -mfloat-abi=soft -nostdlib)
8set(CMAKE_C_COMPILER clang)
9
10# where is the target environment located
11set(CMAKE_FIND_ROOT_PATH /usr/bin)
12
13# adjust the default behavior of the FIND_XXX() commands:
14# search programs in the host environment
15set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
16
17# search headers and libraries in the target environment
18set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
19set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
20
21set(_HAVE_PICOLIBC_TLS_API TRUE)
22
23set(FORMAT_DEFAULT_DOUBLE 1)
24set(FORMAT_DEFAULT_FLOAT 0)
25set(FORMAT_DEFAULT_INTEGER 0)
26
27set(PICOLIBC_LINK_FLAGS
28  --ld-path=/usr/bin/arm-none-eabi-ld
29  -L/usr/lib/gcc/arm-none-eabi/12.2.1/thumb/v7-m/nofp/
30  -Wl,-z,noexecstack
31  -Wl,-no-enum-size-warning
32  -T ${CMAKE_CURRENT_SOURCE_DIR}/cmake/TC-arm-none-eabi.ld
33  -lgcc)
34