1 # Copyright 2020 The Pigweed Authors
3 # Licensed under the Apache License, Version 2.0 (the "License"); you may not
4 # use this file except in compliance with the License. You may obtain a copy of
7 # https://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 # License for the specific language governing permissions and limitations under
15 import("//build_overrides/pigweed.gni")
17 import("$dir_pw_build/facade.gni")
18 import("$dir_pw_build/target_types.gni")
19 import("$dir_pw_docgen/docs.gni")
20 import("$dir_pw_malloc/backend.gni")
21 import("$dir_pw_unit_test/test.gni")
23 config("default_config") {
24 include_dirs = [ "public" ]
27 config("pw_malloc_wrapper_config") {
28 # Link options that provides replace dynamic memory operations in standard
29 # library with the pigweed malloc.
31 # memory allocation -- these must be re-entrant and do locking
37 # Wrap these in case internal newlib call them (e.g. strdup will)
38 # directly call _malloc_r)
39 "-Wl,--wrap=_malloc_r",
40 "-Wl,--wrap=_realloc_r",
42 "-Wl,--wrap=_calloc_r",
46 pw_facade("pw_malloc") {
47 public_configs = [ ":default_config" ]
48 public = [ "public/pw_malloc/malloc.h" ]
49 backend = pw_malloc_BACKEND
52 pw_doc_group("docs") {
53 sources = [ "docs.rst" ]