Skip to content

Commit ed57b42

Browse files
committed
feat: Added an updater script for CMake
1 parent e74fc6f commit ed57b42

File tree

17 files changed

+114
-17
lines changed

17 files changed

+114
-17
lines changed

cmake/boards_db.cmake

Lines changed: 1 addition & 1 deletion
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: "

cmake/scripts/cmake_updater_hook.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
script_dir = pathlib.Path(__file__).parent # Arduino_Core_STM32/cmake/scripts
14+
templates_dir = base_dir/"cmake"/"templates"
15+
16+
print("Updating core/arduino...")
17+
subprocess.run(
18+
("python3", script_dir/"cmake_core.py", base_dir/"cores"/"arduino"),
19+
check=True,
20+
)
21+
22+
print("Updating libraries/...")
23+
subprocess.run(
24+
("python3", script_dir/"cmake_libs.py", "-L", base_dir/"libraries"),
25+
check=True,
26+
)
27+
28+
print("Updating variants/...")
29+
subprocess.run(
30+
("python3", script_dir/"cmake_variant.py", base_dir/"variants"),
31+
check=True,
32+
)
33+
print("Updating board database...")
34+
subprocess.run(
35+
("python3", script_dir/"parse_boards.py",
36+
"-b", base_dir/"boards.txt",
37+
"-p", base_dir/"platform.txt",
38+
"-t", templates_dir/"boards_db.cmake",
39+
"-o", base_dir/"cmake"/"boards_db.cmake",
40+
),
41+
check=True,
42+
)
43+
44+
print("All done !")

cores/arduino/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
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

libraries/SrcWrapper/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ add_library(SrcWrapper_bin OBJECT EXCLUDE_FROM_ALL
6161
src/HAL/stm32yyxx_hal_gfxmmu.c
6262
src/HAL/stm32yyxx_hal_gpio.c
6363
src/HAL/stm32yyxx_hal_gpio_ex.c
64+
src/HAL/stm32yyxx_hal_gpu2d.c
6465
src/HAL/stm32yyxx_hal_gtzc.c
6566
src/HAL/stm32yyxx_hal_hash.c
6667
src/HAL/stm32yyxx_hal_hash_ex.c
@@ -131,6 +132,8 @@ add_library(SrcWrapper_bin OBJECT EXCLUDE_FROM_ALL
131132
src/HAL/stm32yyxx_hal_usart.c
132133
src/HAL/stm32yyxx_hal_usart_ex.c
133134
src/HAL/stm32yyxx_hal_wwdg.c
135+
src/HAL/stm32yyxx_hal_xspi.c
136+
src/HardwareTimer.cpp
134137
src/LL/stm32yyxx_ll_adc.c
135138
src/LL/stm32yyxx_ll_bdma.c
136139
src/LL/stm32yyxx_ll_comp.c
@@ -169,6 +172,7 @@ add_library(SrcWrapper_bin OBJECT EXCLUDE_FROM_ALL
169172
src/LL/stm32yyxx_ll_usart.c
170173
src/LL/stm32yyxx_ll_usb.c
171174
src/LL/stm32yyxx_ll_utils.c
175+
src/new.cpp
172176
src/stm32/PortNames.c
173177
src/stm32/analog.cpp
174178
src/stm32/bootloader.c

variants/STM32G4xx/GBK1CBT/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
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)

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

Lines changed: 5 additions & 1 deletion
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)

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

Lines changed: 5 additions & 1 deletion
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)

variants/STM32H7xx/H730IBKxQ/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
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)

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

Lines changed: 5 additions & 1 deletion
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)

variants/STM32H7xx/H730ZBT/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy