1 # Copyright 2021 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("clang_config.gni")
19 cortex_m_common_flags = [
24 cortex_m_software_fpu_flags = [ "-mfloat-abi=soft" ]
26 cortex_m_hardware_fpu_flags = [
30 # Used by some pigweed tests/targets to correctly handle hardware FPU
32 "-DPW_ARMV7M_ENABLE_FPU=1",
35 config("enable_float_printf") {
36 ldflags = [ "-Wl,-u_printf_float" ]
39 pw_clang_arm_config("cortex_m3") {
40 cflags = [ "-mcpu=cortex-m3" ]
41 cflags += cortex_m_common_flags
42 cflags += cortex_m_software_fpu_flags
47 pw_clang_arm_config("cortex_m4f") {
48 cflags = [ "-mcpu=cortex-m4" ]
49 cflags += cortex_m_common_flags
50 cflags += cortex_m_hardware_fpu_flags