Skip to content

Commit f46aff1

Browse files
committed
feat: Added an updater script for CMake
1 parent 457f6fe commit f46aff1

File tree

17 files changed

+112
-17
lines changed

17 files changed

+112
-17
lines changed

Diff for: cmake/boards_db.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set(ACSIP_S76S_MCU cortex-m0plus)
88
set(ACSIP_S76S_FPCONF "-")
99
add_library(ACSIP_S76S INTERFACE)
1010
target_compile_options(ACSIP_S76S INTERFACE
11-
"SHELL:-DSTM32L073xx -D__CORTEX_SC=0"
11+
"SHELL:-DSTM32L073xx "
1212
"SHELL:-DCUSTOM_PERIPHERAL_PINS"
1313
"SHELL:"
1414
"SHELL: "

Diff for: cmake/scripts/cmake_updater_hook.py

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env python3
2+
3+
"""
4+
This file centralizes all the operations needed to regenerate the CMakeLists.txt scattered along this repo.
5+
Hint: it would be a good practice to run it before committing...
6+
"""
7+
8+
import subprocess
9+
import pathlib
10+
11+
script_dir = pathlib.Path(__file__).parent # Arduino_Core_STM32/cmake/scripts
12+
base_dir = script_dir.parent.parent # Arduino_Core_STM32
13+
templates_dir = base_dir/"cmake"/"templates"
14+
15+
print("Updating core/arduino...")
16+
subprocess.run(
17+
("python3", script_dir/"cmake_core.py", base_dir/"cores"/"arduino"),
18+
check=True,
19+
)
20+
21+
print("Updating libraries/...")
22+
subprocess.run(
23+
("python3", script_dir/"cmake_libs.py", "-L", base_dir/"libraries"),
24+
check=True,
25+
)
26+
27+
print("Updating variants/...")
28+
subprocess.run(
29+
("python3", script_dir/"cmake_variant.py", base_dir/"variants"),
30+
check=True,
31+
)
32+
print("Updating board database...")
33+
subprocess.run(
34+
("python3", script_dir/"parse_boards.py",
35+
"-b", base_dir/"boards.txt",
36+
"-p", base_dir/"platform.txt",
37+
"-t", templates_dir/"boards_db.cmake",
38+
"-o", base_dir/"cmake"/"boards_db.cmake",
39+
),
40+
check=True,
41+
)
42+
43+
print("All done !")

Diff for: cores/arduino/CMakeLists.txt

-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ target_link_libraries(core INTERFACE core_usage)
2020

2121
add_library(core_bin STATIC EXCLUDE_FROM_ALL
2222
HardwareSerial.cpp
23-
HardwareTimer.cpp
2423
IPAddress.cpp
2524
Print.cpp
2625
RingBuffer.cpp
@@ -35,11 +34,9 @@ add_library(core_bin STATIC EXCLUDE_FROM_ALL
3534
abi.cpp
3635
avr/dtostrf.c
3736
board.c
38-
core_debug.c
3937
hooks.c
4038
itoa.c
4139
main.cpp
42-
new.cpp
4340
pins_arduino.c
4441
stm32/OpenAMP/libmetal/device.c
4542
stm32/OpenAMP/libmetal/generic/condition.c

Diff for: libraries/SrcWrapper/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ add_library(SrcWrapper_bin OBJECT EXCLUDE_FROM_ALL
6060
src/HAL/stm32yyxx_hal_gfxmmu.c
6161
src/HAL/stm32yyxx_hal_gpio.c
6262
src/HAL/stm32yyxx_hal_gpio_ex.c
63+
src/HAL/stm32yyxx_hal_gpu2d.c
6364
src/HAL/stm32yyxx_hal_gtzc.c
6465
src/HAL/stm32yyxx_hal_hash.c
6566
src/HAL/stm32yyxx_hal_hash_ex.c
@@ -130,6 +131,8 @@ add_library(SrcWrapper_bin OBJECT EXCLUDE_FROM_ALL
130131
src/HAL/stm32yyxx_hal_usart.c
131132
src/HAL/stm32yyxx_hal_usart_ex.c
132133
src/HAL/stm32yyxx_hal_wwdg.c
134+
src/HAL/stm32yyxx_hal_xspi.c
135+
src/HardwareTimer.cpp
133136
src/LL/stm32yyxx_ll_adc.c
134137
src/LL/stm32yyxx_ll_bdma.c
135138
src/LL/stm32yyxx_ll_comp.c

Diff for: variants/STM32G4xx/GBK1CBT/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v3.21 implemented semantic changes regarding $<TARGET_OBJECTS:...>
2+
# See https://cmake.org/cmake/help/v3.21/command/target_link_libraries.html#linking-object-libraries-via-target-objects
3+
cmake_minimum_required(VERSION 3.21)
4+
15
add_library(variant INTERFACE)
26
add_library(variant_usage INTERFACE)
37

@@ -7,7 +11,7 @@ target_include_directories(variant_usage INTERFACE
711

812

913
target_link_libraries(variant_usage INTERFACE
10-
core_config
14+
base_config
1115
)
1216

1317
target_link_libraries(variant INTERFACE variant_usage)

Diff for: variants/STM32H7xx/H725V(E-G)H/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v3.21 implemented semantic changes regarding $<TARGET_OBJECTS:...>
2+
# See https://cmake.org/cmake/help/v3.21/command/target_link_libraries.html#linking-object-libraries-via-target-objects
3+
cmake_minimum_required(VERSION 3.21)
4+
15
add_library(variant INTERFACE)
26
add_library(variant_usage INTERFACE)
37

@@ -7,7 +11,7 @@ target_include_directories(variant_usage INTERFACE
711

812

913
target_link_libraries(variant_usage INTERFACE
10-
core_config
14+
base_config
1115
)
1216

1317
target_link_libraries(variant INTERFACE variant_usage)

Diff for: variants/STM32H7xx/H725V(E-G)T/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v3.21 implemented semantic changes regarding $<TARGET_OBJECTS:...>
2+
# See https://cmake.org/cmake/help/v3.21/command/target_link_libraries.html#linking-object-libraries-via-target-objects
3+
cmake_minimum_required(VERSION 3.21)
4+
15
add_library(variant INTERFACE)
26
add_library(variant_usage INTERFACE)
37

@@ -7,7 +11,7 @@ target_include_directories(variant_usage INTERFACE
711

812

913
target_link_libraries(variant_usage INTERFACE
10-
core_config
14+
base_config
1115
)
1216

1317
target_link_libraries(variant INTERFACE variant_usage)

Diff for: variants/STM32H7xx/H730IBKxQ/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v3.21 implemented semantic changes regarding $<TARGET_OBJECTS:...>
2+
# See https://cmake.org/cmake/help/v3.21/command/target_link_libraries.html#linking-object-libraries-via-target-objects
3+
cmake_minimum_required(VERSION 3.21)
4+
15
add_library(variant INTERFACE)
26
add_library(variant_usage INTERFACE)
37

@@ -7,7 +11,7 @@ target_include_directories(variant_usage INTERFACE
711

812

913
target_link_libraries(variant_usage INTERFACE
10-
core_config
14+
base_config
1115
)
1216

1317
target_link_libraries(variant INTERFACE variant_usage)

Diff for: variants/STM32H7xx/H730VB(H-T)/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v3.21 implemented semantic changes regarding $<TARGET_OBJECTS:...>
2+
# See https://cmake.org/cmake/help/v3.21/command/target_link_libraries.html#linking-object-libraries-via-target-objects
3+
cmake_minimum_required(VERSION 3.21)
4+
15
add_library(variant INTERFACE)
26
add_library(variant_usage INTERFACE)
37

@@ -7,7 +11,7 @@ target_include_directories(variant_usage INTERFACE
711

812

913
target_link_libraries(variant_usage INTERFACE
10-
core_config
14+
base_config
1115
)
1216

1317
target_link_libraries(variant INTERFACE variant_usage)

Diff for: variants/STM32H7xx/H730ZBT/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v3.21 implemented semantic changes regarding $<TARGET_OBJECTS:...>
2+
# See https://cmake.org/cmake/help/v3.21/command/target_link_libraries.html#linking-object-libraries-via-target-objects
3+
cmake_minimum_required(VERSION 3.21)
4+
15
add_library(variant INTERFACE)
26
add_library(variant_usage INTERFACE)
37

@@ -7,7 +11,7 @@ target_include_directories(variant_usage INTERFACE
711

812

913
target_link_libraries(variant_usage INTERFACE
10-
core_config
14+
base_config
1115
)
1216

1317
target_link_libraries(variant INTERFACE variant_usage)

Diff for: variants/STM32H7xx/H735VGH/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v3.21 implemented semantic changes regarding $<TARGET_OBJECTS:...>
2+
# See https://cmake.org/cmake/help/v3.21/command/target_link_libraries.html#linking-object-libraries-via-target-objects
3+
cmake_minimum_required(VERSION 3.21)
4+
15
add_library(variant INTERFACE)
26
add_library(variant_usage INTERFACE)
37

@@ -7,7 +11,7 @@ target_include_directories(variant_usage INTERFACE
711

812

913
target_link_libraries(variant_usage INTERFACE
10-
core_config
14+
base_config
1115
)
1216

1317
target_link_libraries(variant INTERFACE variant_usage)

Diff for: variants/STM32H7xx/H735VGT/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v3.21 implemented semantic changes regarding $<TARGET_OBJECTS:...>
2+
# See https://cmake.org/cmake/help/v3.21/command/target_link_libraries.html#linking-object-libraries-via-target-objects
3+
cmake_minimum_required(VERSION 3.21)
4+
15
add_library(variant INTERFACE)
26
add_library(variant_usage INTERFACE)
37

@@ -7,7 +11,7 @@ target_include_directories(variant_usage INTERFACE
711

812

913
target_link_libraries(variant_usage INTERFACE
10-
core_config
14+
base_config
1115
)
1216

1317
target_link_libraries(variant INTERFACE variant_usage)

Diff for: variants/STM32WBxx/WB30CEUxA/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v3.21 implemented semantic changes regarding $<TARGET_OBJECTS:...>
2+
# See https://cmake.org/cmake/help/v3.21/command/target_link_libraries.html#linking-object-libraries-via-target-objects
3+
cmake_minimum_required(VERSION 3.21)
4+
15
add_library(variant INTERFACE)
26
add_library(variant_usage INTERFACE)
37

@@ -7,7 +11,7 @@ target_include_directories(variant_usage INTERFACE
711

812

913
target_link_libraries(variant_usage INTERFACE
10-
core_config
14+
base_config
1115
)
1216

1317
target_link_libraries(variant INTERFACE variant_usage)

Diff for: variants/STM32WBxx/WB35C(C-E)UxA/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v3.21 implemented semantic changes regarding $<TARGET_OBJECTS:...>
2+
# See https://cmake.org/cmake/help/v3.21/command/target_link_libraries.html#linking-object-libraries-via-target-objects
3+
cmake_minimum_required(VERSION 3.21)
4+
15
add_library(variant INTERFACE)
26
add_library(variant_usage INTERFACE)
37

@@ -7,7 +11,7 @@ target_include_directories(variant_usage INTERFACE
711

812

913
target_link_libraries(variant_usage INTERFACE
10-
core_config
14+
base_config
1115
)
1216

1317
target_link_libraries(variant INTERFACE variant_usage)

Diff for: variants/STM32WBxx/WB50CGU/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v3.21 implemented semantic changes regarding $<TARGET_OBJECTS:...>
2+
# See https://cmake.org/cmake/help/v3.21/command/target_link_libraries.html#linking-object-libraries-via-target-objects
3+
cmake_minimum_required(VERSION 3.21)
4+
15
add_library(variant INTERFACE)
26
add_library(variant_usage INTERFACE)
37

@@ -7,7 +11,7 @@ target_include_directories(variant_usage INTERFACE
711

812

913
target_link_libraries(variant_usage INTERFACE
10-
core_config
14+
base_config
1115
)
1216

1317
target_link_libraries(variant INTERFACE variant_usage)

Diff for: variants/STM32WBxx/WB55C(C-E-G)U/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v3.21 implemented semantic changes regarding $<TARGET_OBJECTS:...>
2+
# See https://cmake.org/cmake/help/v3.21/command/target_link_libraries.html#linking-object-libraries-via-target-objects
3+
cmake_minimum_required(VERSION 3.21)
4+
15
add_library(variant INTERFACE)
26
add_library(variant_usage INTERFACE)
37

@@ -7,7 +11,7 @@ target_include_directories(variant_usage INTERFACE
711

812

913
target_link_libraries(variant_usage INTERFACE
10-
core_config
14+
base_config
1115
)
1216

1317
target_link_libraries(variant INTERFACE variant_usage)

Diff for: variants/STM32WLxx/WL55UCY_WLE5U(8-B)Y/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v3.21 implemented semantic changes regarding $<TARGET_OBJECTS:...>
2+
# See https://cmake.org/cmake/help/v3.21/command/target_link_libraries.html#linking-object-libraries-via-target-objects
3+
cmake_minimum_required(VERSION 3.21)
4+
15
add_library(variant INTERFACE)
26
add_library(variant_usage INTERFACE)
37

@@ -7,7 +11,7 @@ target_include_directories(variant_usage INTERFACE
711

812

913
target_link_libraries(variant_usage INTERFACE
10-
core_config
14+
base_config
1115
)
1216

1317
target_link_libraries(variant INTERFACE variant_usage)

0 commit comments

Comments
 (0)