@@ -22,6 +22,50 @@ if(_soc_build_aarch32_neon_fma)
2222 )
2323endif ()
2424
25+ add_library (
26+ soc_device_support
27+ OBJECT
28+ abi/soc_device_support.c
29+ )
30+ target_include_directories (
31+ soc_device_support
32+ PRIVATE
33+ "${PROJECT_SOURCE_DIR } /include"
34+ "${CMAKE_CURRENT_SOURCE_DIR } "
35+ )
36+ target_compile_features (soc_device_support PRIVATE c_std_17 )
37+ set_target_properties (
38+ soc_device_support
39+ PROPERTIES
40+ C_VISIBILITY_PRESET hidden
41+ INTERPROCEDURAL_OPTIMIZATION FALSE
42+ POSITION_INDEPENDENT_CODE ON
43+ )
44+ soc_enable_warnings (soc_device_support )
45+ if (SOC_BUILD_SHARED)
46+ target_compile_definitions (
47+ soc_device_support
48+ PRIVATE SOC_BUILDING_LIBRARY
49+ )
50+ else ()
51+ target_compile_definitions (soc_device_support PRIVATE SOC_STATIC )
52+ endif ()
53+ if (_soc_build_aarch32_neon_fma)
54+ target_compile_definitions (
55+ soc_device_support
56+ PRIVATE
57+ $<$<CONFIG :Release >:SOC_ABI_REQUIRES_ARM32_NEON_VFPV4 =1>
58+ )
59+ target_compile_options (
60+ soc_device_support
61+ PRIVATE
62+ $<$<CONFIG :Release >:-march =armv7 -a >
63+ $<$<CONFIG :Release >:-mfpu =vfpv3 -d16 >
64+ $<$<CONFIG :Release >:-mfloat -abi =softfp >
65+ $<$<CONFIG :Release >:-fno -lto >
66+ )
67+ endif ()
68+
2569add_library (
2670 soc_core
2771 OBJECT
@@ -123,6 +167,7 @@ if(SOC_BUILD_SHARED)
123167 soc
124168 SHARED
125169 abi/soc_api.c
170+ $<TARGET_OBJECTS :soc_device_support >
126171 $<TARGET_OBJECTS :soc_core >
127172 )
128173 target_compile_definitions (soc PRIVATE SOC_BUILDING_LIBRARY )
@@ -131,6 +176,7 @@ else()
131176 soc
132177 STATIC
133178 abi/soc_api.c
179+ $<TARGET_OBJECTS :soc_device_support >
134180 $<TARGET_OBJECTS :soc_core >
135181 )
136182 target_compile_definitions (soc PUBLIC SOC_STATIC )
0 commit comments