From 0bd9c8d7aed3bc52daeb0dce576dbcfeaff07f74 Mon Sep 17 00:00:00 2001 From: anjiahao Date: Mon, 3 Jun 2024 20:06:23 +0800 Subject: [PATCH] Kconfig:Add an option to disable compilation of floating point related files Signed-off-by: anjiahao --- Kconfig | 8 ++++++++ include/nuttx/compiler.h | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/Kconfig b/Kconfig index 3fc3d8ecd21..090ae6c0e67 100644 --- a/Kconfig +++ b/Kconfig @@ -567,6 +567,14 @@ config ARCH_FLOAT_H there is no assurance that the settings in this float.h are actually correct for your platform! +config DISABLE_FLOAT + bool "Disable floating point" + default n + ---help--- + Disable floating point support in the compiler. This will reduce + code size and increase performance. This option is only available + on some architectures. + config ARCH_HAVE_STDARG_H bool default n diff --git a/include/nuttx/compiler.h b/include/nuttx/compiler.h index f0374298cc9..293775f1933 100644 --- a/include/nuttx/compiler.h +++ b/include/nuttx/compiler.h @@ -1207,6 +1207,12 @@ # undef CONFIG_FS_LARGEFILE #endif +#ifdef CONFIG_DISABLE_FLOAT +# undef CONFIG_HAVE_FLOAT +# undef CONFIG_HAVE_DOUBLE +# undef CONFIG_HAVE_LONG_DOUBLE +#endif + /**************************************************************************** * Public Function Prototypes ****************************************************************************/