File tree 2 files changed +38
-0
lines changed
2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,24 @@ idf_component_register(
3
3
INCLUDE_DIRS "."
4
4
)
5
5
6
+ idf_build_get_property(target IDF_TARGET)
7
+ idf_build_get_property(arch IDF_TARGET_ARCH)
8
+
9
+ if ("${arch} " STREQUAL "xtensa" )
10
+ message (FATAL_ERROR "Not supported target: ${target} " )
11
+ endif ()
12
+
13
+ if (${target} STREQUAL "esp32c2" OR ${target} STREQUAL "esp32c3" )
14
+ set (march_flag "rv32imc_zicsr_zifencei" )
15
+ set (mabi_flag "ilp32" )
16
+ elseif (${target} STREQUAL "esp32p4" )
17
+ set (march_flag "rv32imafc_zicsr_zifencei" )
18
+ set (mabi_flag "ilp32f" )
19
+ else ()
20
+ set (march_flag "rv32imac_zicsr_zifencei" )
21
+ set (mabi_flag "ilp32" )
22
+ endif ()
23
+
6
24
execute_process (COMMAND xcrun -f swiftc OUTPUT_VARIABLE SWIFTC OUTPUT_STRIP_TRAILING_WHITESPACE)
7
25
8
26
add_custom_command (
@@ -11,6 +29,7 @@ add_custom_command(
11
29
${SWIFTC}
12
30
-target riscv32-none-none-eabi
13
31
-Xfrontend -function-sections -enable-experimental-feature Embedded -wmo -parse-as-library -Osize
32
+ -Xcc -march=${march_flag} -Xcc -mabi=${mabi_flag}
14
33
$$\( echo '$<TARGET_PROPERTY:__idf_main,INCLUDE_DIRECTORIES >' | tr '\;' '\\n' | sed -e 's/\\\(.*\\\)/-Xcc -I\\1/g' \)
15
34
$$\( echo '${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES} ' | tr ' ' '\\n' | sed -e 's/\\\(.*\\\)/-Xcc -I\\1/g' \)
16
35
-import-bridging-header ${CMAKE_CURRENT_LIST_DIR} /BridgingHeader.h
Original file line number Diff line number Diff line change @@ -3,6 +3,24 @@ idf_component_register(
3
3
INCLUDE_DIRS "."
4
4
)
5
5
6
+ idf_build_get_property(target IDF_TARGET)
7
+ idf_build_get_property(arch IDF_TARGET_ARCH)
8
+
9
+ if ("${arch} " STREQUAL "xtensa" )
10
+ message (FATAL_ERROR "Not supported target: ${target} " )
11
+ endif ()
12
+
13
+ if (${target} STREQUAL "esp32c2" OR ${target} STREQUAL "esp32c3" )
14
+ set (march_flag "rv32imc_zicsr_zifencei" )
15
+ set (mabi_flag "ilp32" )
16
+ elseif (${target} STREQUAL "esp32p4" )
17
+ set (march_flag "rv32imafc_zicsr_zifencei" )
18
+ set (mabi_flag "ilp32f" )
19
+ else ()
20
+ set (march_flag "rv32imac_zicsr_zifencei" )
21
+ set (mabi_flag "ilp32" )
22
+ endif ()
23
+
6
24
execute_process (COMMAND xcrun -f swiftc OUTPUT_VARIABLE SWIFTC OUTPUT_STRIP_TRAILING_WHITESPACE)
7
25
8
26
add_custom_command (
@@ -11,6 +29,7 @@ add_custom_command(
11
29
${SWIFTC}
12
30
-target riscv32-none-none-eabi
13
31
-Xfrontend -function-sections -enable-experimental-feature Embedded -wmo -parse-as-library -Osize
32
+ -Xcc -march=${march_flag} -Xcc -mabi=${mabi_flag}
14
33
$$\( echo '$<TARGET_PROPERTY:__idf_main,INCLUDE_DIRECTORIES >' | tr '\;' '\\n' | sed -e 's/\\\(.*\\\)/-Xcc -I\\1/g' \)
15
34
$$\( echo '${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES} ' | tr ' ' '\\n' | sed -e 's/\\\(.*\\\)/-Xcc -I\\1/g' \)
16
35
-import-bridging-header ${CMAKE_CURRENT_LIST_DIR} /BridgingHeader.h
You can’t perform that action at this time.
0 commit comments