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 thumbv7m-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(PICOLIBC_LINK_FLAGS
24  --ld-path=/usr/bin/arm-none-eabi-ld
25  -L/usr/lib/gcc/arm-none-eabi/12.2.1/thumb/v7-m/nofp/
26  -L/usr/lib/gcc/arm-none-eabi/12.3.1/thumb/v7-m/nofp/
27  -Wl,-z,noexecstack
28  -Wl,-no-enum-size-warning
29  -T ${CMAKE_CURRENT_SOURCE_DIR}/cmake/TC-arm-none-eabi.ld
30  -lgcc)
31