summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author冥焱破晓 <[email protected]>2025-05-21 22:15:04 +0800
committerGitHub <[email protected]>2025-05-21 22:15:04 +0800
commitd64ce335fc00d99e681fd920754c1e8eba03786c (patch)
tree23d33aff258cb1a034baa84a6036585c58330861
parentcd3789f8ec69b50deac7c41ca9f4e4a849fb5996 (diff)
fix scons --target=cmake command failure (#10276)
* fix scons --target=cmake command failure * fix scons --menuconfig scons: Reading SConscript files ... Cannot found RT-Thread root directory, please check RTT_ROOT
-rw-r--r--bsp/stm32/stm32h723-st-nucleo/SConscript1
-rw-r--r--tools/cmake.py4
2 files changed, 3 insertions, 2 deletions
diff --git a/bsp/stm32/stm32h723-st-nucleo/SConscript b/bsp/stm32/stm32h723-st-nucleo/SConscript
index 8c1ff21374..8fe7d71418 100644
--- a/bsp/stm32/stm32h723-st-nucleo/SConscript
+++ b/bsp/stm32/stm32h723-st-nucleo/SConscript
@@ -1,5 +1,6 @@
# for module compiling
import os
+Import('RTT_ROOT')
Import('env')
from building import *
diff --git a/tools/cmake.py b/tools/cmake.py
index 7f7c26eb6c..e998a48e8c 100644
--- a/tools/cmake.py
+++ b/tools/cmake.py
@@ -149,11 +149,11 @@ def GenerateCFiles(env, project, project_name):
if 'LIBS' in group.keys():
for f in group['LIBS']:
LINKER_LIBS += ' ' + f.replace("\\", "/") + '.lib'
- cm_file.write("SET(CMAKE_EXE_LINKER_FLAGS \""+ re.sub(LINKER_FLAGS + '(\s*)', LINKER_FLAGS + ' ${CMAKE_SOURCE_DIR}/', LFLAGS) + LINKER_LIBS + "\")\n\n")
+ cm_file.write("SET(CMAKE_EXE_LINKER_FLAGS \""+ re.sub(LINKER_FLAGS + r'(\s*)', LINKER_FLAGS + r' ${CMAKE_SOURCE_DIR}/', LFLAGS) + LINKER_LIBS + "\")\n\n")
# get the c/cpp standard version from compilation flags
# not support the version with alphabet in `-std` param yet
- pattern = re.compile('-std=[\w+]+')
+ pattern = re.compile(r'-std=[\w+]+')
c_standard = 11
if '-std=' in CFLAGS:
c_standard = re.search(pattern, CFLAGS).group(0)