Skip to content

Commit d64ce33

Browse files
authored
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
1 parent cd3789f commit d64ce33

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

bsp/stm32/stm32h723-st-nucleo/SConscript

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# for module compiling
22
import os
3+
Import('RTT_ROOT')
34
Import('env')
45
from building import *
56

tools/cmake.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,11 @@ def GenerateCFiles(env, project, project_name):
149149
if 'LIBS' in group.keys():
150150
for f in group['LIBS']:
151151
LINKER_LIBS += ' ' + f.replace("\\", "/") + '.lib'
152-
cm_file.write("SET(CMAKE_EXE_LINKER_FLAGS \""+ re.sub(LINKER_FLAGS + '(\s*)', LINKER_FLAGS + ' ${CMAKE_SOURCE_DIR}/', LFLAGS) + LINKER_LIBS + "\")\n\n")
152+
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")
153153

154154
# get the c/cpp standard version from compilation flags
155155
# not support the version with alphabet in `-std` param yet
156-
pattern = re.compile('-std=[\w+]+')
156+
pattern = re.compile(r'-std=[\w+]+')
157157
c_standard = 11
158158
if '-std=' in CFLAGS:
159159
c_standard = re.search(pattern, CFLAGS).group(0)

0 commit comments

Comments
 (0)