Imre Kis | da8d58f | 2024-05-29 14:19:49 +0200 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
| 2 | # Copyright (c) 2024, Arm Limited. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
| 8 | cmake_minimum_required(VERSION 3.18 FATAL_ERROR) |
| 9 | |
| 10 | project(c LANGUAGES C) |
| 11 | |
| 12 | # Define our target |
| 13 | add_library(c STATIC "") |
| 14 | |
| 15 | # Define include directories |
| 16 | target_include_directories(c PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") |
| 17 | target_include_directories(c PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include/aarch64") |
| 18 | |
| 19 | include(${TS_ROOT}/tools/cmake/compiler/GCC.cmake) |
| 20 | compiler_set_freestanding(TARGET c) |
| 21 | |
| 22 | # Add source files to be compiled. |
| 23 | target_sources(c PRIVATE |
| 24 | "src/abort.c" |
| 25 | "src/assert.c" |
| 26 | "src/ctype.c" |
| 27 | "src/exit.c" |
| 28 | "src/memchr.c" |
| 29 | "src/memcmp.c" |
| 30 | "src/memcpy.c" |
| 31 | "src/memmove.c" |
| 32 | "src/memset.c" |
| 33 | "src/printf.c" |
| 34 | "src/putchar.c" |
| 35 | "src/puts.c" |
| 36 | "src/snprintf.c" |
| 37 | "src/strcpy.c" |
| 38 | "src/strlcat.c" |
| 39 | "src/strchr.c" |
| 40 | "src/strcmp.c" |
| 41 | "src/strlcpy.c" |
| 42 | "src/strlen.c" |
| 43 | "src/strncmp.c" |
| 44 | "src/strnlen.c" |
| 45 | "src/strrchr.c" |
| 46 | "src/strstr.c" |
| 47 | "src/strtok.c" |
| 48 | "src/strtol.c" |
| 49 | "src/strtok.c" |
| 50 | "src/strtoll.c" |
| 51 | "src/strtoul.c" |
| 52 | "src/strtoull.c" |
| 53 | ) |
| 54 | |
| 55 | target_compile_definitions(c INTERFACE ENABLE_CDEFSH_FIX) |
| 56 | |
| 57 | add_library(stdlib::c ALIAS c) |