1# SPDX-License-Identifier: Apache-2.0
2
3if(CONFIG_GP_NONE)
4set(gpopt none)
5elseif(CONFIG_GP_LOCAL)
6set(gpopt local)
7elseif(CONFIG_GP_GLOBAL)
8set(gpopt global)
9elseif(CONFIG_GP_ALL_DATA)
10set(gpopt data)
11endif()
12
13# Set Global Pointer option based on Kconfig.
14zephyr_cc_option(-mgpopt=${gpopt})
15
16# TODO Find a way to pull this out of system.h somehow
17# instead of having Kconfig for it
18
19if(CONFIG_HAS_MUL_INSTRUCTION)
20zephyr_cc_option(-mhw-mul)
21else()
22zephyr_cc_option(-mno-hw-mul)
23endif()
24
25if(CONFIG_HAS_MULX_INSTRUCTION)
26zephyr_cc_option(-mhw-mulx)
27else()
28zephyr_cc_option(-mno-hw-mulx)
29endif()
30
31if(CONFIG_HAS_DIV_INSTRUCTION)
32zephyr_cc_option(-mhw-div)
33else()
34zephyr_cc_option(-mno-hw-div)
35endif()
36
37add_subdirectory(core)
38