1# Copyright 2020 The Pigweed Authors
2#
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
5# the License at
6#
7#     https://www.apache.org/licenses/LICENSE-2.0
8#
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
13# the License.
14
15import("//build_overrides/pigweed.gni")
16
17import("$dir_pw_build/target_types.gni")
18import("freertos.gni")
19
20# This file defines a GN source_set for an external installation of freertos.
21# To use, checkout the freertos source into a directory, then set the build arg
22# dir_pw_third_party_freertos to point to that directory. The freertos library
23# will be available in GN at "$dir_pw_third_party/freertos".
24if (dir_pw_third_party_freertos != "") {
25  config("disable_warnings") {
26    cflags = [ "-Wno-error=unused-parameter" ]
27    visibility = [ ":*" ]
28  }
29
30  config("public_includes") {
31    include_dirs = [ "Source/include" ]
32    visibility = [ ":*" ]
33  }
34
35  pw_source_set("freertos") {
36    public_configs = [ ":public_includes" ]
37    allow_circular_includes_from = [ pw_third_party_freertos_PORT ]
38    public_deps = [
39      pw_third_party_freertos_CONFIG,
40      pw_third_party_freertos_PORT,
41    ]
42    public = [
43      "$dir_pw_third_party_freertos/Source/include/FreeRTOS.h",
44      "$dir_pw_third_party_freertos/Source/include/StackMacros.h",
45      "$dir_pw_third_party_freertos/Source/include/croutine.h",
46      "$dir_pw_third_party_freertos/Source/include/deprecated_definitions.h",
47      "$dir_pw_third_party_freertos/Source/include/event_groups.h",
48      "$dir_pw_third_party_freertos/Source/include/list.h",
49      "$dir_pw_third_party_freertos/Source/include/message_buffer.h",
50      "$dir_pw_third_party_freertos/Source/include/mpu_prototypes.h",
51      "$dir_pw_third_party_freertos/Source/include/mpu_wrappers.h",
52      "$dir_pw_third_party_freertos/Source/include/portable.h",
53      "$dir_pw_third_party_freertos/Source/include/projdefs.h",
54      "$dir_pw_third_party_freertos/Source/include/queue.h",
55      "$dir_pw_third_party_freertos/Source/include/semphr.h",
56      "$dir_pw_third_party_freertos/Source/include/stack_macros.h",
57      "$dir_pw_third_party_freertos/Source/include/stream_buffer.h",
58      "$dir_pw_third_party_freertos/Source/include/task.h",
59      "$dir_pw_third_party_freertos/Source/include/timers.h",
60    ]
61    configs = [ ":disable_warnings" ]
62    sources = [
63      "$dir_pw_third_party_freertos/Source/croutine.c",
64      "$dir_pw_third_party_freertos/Source/event_groups.c",
65      "$dir_pw_third_party_freertos/Source/list.c",
66      "$dir_pw_third_party_freertos/Source/queue.c",
67      "$dir_pw_third_party_freertos/Source/stream_buffer.c",
68      "$dir_pw_third_party_freertos/Source/tasks.c",
69      "$dir_pw_third_party_freertos/Source/timers.c",
70    ]
71  }
72} else {
73  group("freertos") {
74  }
75}
76