blob: 3059c510b60dd3671a6b82587b3842d51ba7bdb4 [file] [log] [blame]
Imre Kisda8d58f2024-05-29 14:19:49 +02001#-------------------------------------------------------------------------------
2# Copyright (c) 2024, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
9
10project(c LANGUAGES C)
11
12# Define our target
13add_library(c STATIC "")
14
15# Define include directories
16target_include_directories(c PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
17target_include_directories(c PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include/aarch64")
18
19include(${TS_ROOT}/tools/cmake/compiler/GCC.cmake)
20compiler_set_freestanding(TARGET c)
21
22# Add source files to be compiled.
23target_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
55target_compile_definitions(c INTERFACE ENABLE_CDEFSH_FIX)
56
57add_library(stdlib::c ALIAS c)