zephyr/cmake/compiler/gcc/target_optimizations.cmake
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00

28 lines
948 B
CMake

# SPDX-License-Identifier: Apache-2.0
# See root CMakeLists.txt for description and expectations of this macro
#
# NOTE: Some GNU toolchains break with plain '-Os' or '-Og', but is fixable
# with tweaks. So allow user to override, via ifndef, the compile flags that
# CONFIG_{NO,DEBUG,SPEED,SIZE}_OPTIMIZATIONS will cause, yet still leaving the
# selection logic in kconfig.
#
# These macros leaves it up to the root CMakeLists.txt to choose the CMake
# variable names to store the optimization flags in.
macro(toolchain_cc_optimize_for_no_optimizations_flag dest_var_name)
set_ifndef(${dest_var_name} "-O0")
endmacro()
macro(toolchain_cc_optimize_for_debug_flag dest_var_name)
set_ifndef(${dest_var_name} "-Og")
endmacro()
macro(toolchain_cc_optimize_for_speed_flag dest_var_name)
set_ifndef(${dest_var_name} "-O2")
endmacro()
macro(toolchain_cc_optimize_for_size_flag dest_var_name)
set_ifndef(${dest_var_name} "-Os")
endmacro()