Skip to content

Commit d272c9a

Browse files
authored
Merge pull request #3856 from SummerLife/master_710
[stm32][bsp] fix stm32f769-st-disco bsp scons --dist function
2 parents 3626325 + a187701 commit d272c9a

File tree

2 files changed

+26
-10
lines changed

2 files changed

+26
-10
lines changed

bsp/stm32/libraries/templates/stm32f7xx/SConstruct

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,27 @@ if rtconfig.PLATFORM == 'iar':
3434
Export('RTT_ROOT')
3535
Export('rtconfig')
3636

37+
SDK_ROOT = os.path.abspath('./')
38+
39+
if os.path.exists(SDK_ROOT + '/libraries'):
40+
libraries_path_prefix = SDK_ROOT + '/libraries'
41+
else:
42+
libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries'
43+
44+
SDK_LIB = libraries_path_prefix
45+
Export('SDK_LIB')
46+
3747
# prepare building environment
3848
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
3949

4050
stm32_library = 'STM32F7xx_HAL'
4151
rtconfig.BSP_LIBRARY_TYPE = stm32_library
4252

43-
SDK_ROOT = os.path.abspath('./')
53+
# include libraries
54+
objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript')))
4455

4556
# include drivers
46-
objs.extend(SConscript(os.path.dirname(SDK_ROOT) + '/libraries/STM32F7xx_HAL/SConscript'))
47-
48-
# include libraries
49-
objs.extend(SConscript(os.path.dirname(SDK_ROOT) + '/libraries/HAL_Drivers/SConscript'))
57+
objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript')))
5058

5159
# make a building
5260
DoBuilding(TARGET, objs)

bsp/stm32/stm32f769-st-disco/SConstruct

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,27 @@ if rtconfig.PLATFORM == 'iar':
3434
Export('RTT_ROOT')
3535
Export('rtconfig')
3636

37+
SDK_ROOT = os.path.abspath('./')
38+
39+
if os.path.exists(SDK_ROOT + '/libraries'):
40+
libraries_path_prefix = SDK_ROOT + '/libraries'
41+
else:
42+
libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries'
43+
44+
SDK_LIB = libraries_path_prefix
45+
Export('SDK_LIB')
46+
3747
# prepare building environment
3848
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
3949

4050
stm32_library = 'STM32F7xx_HAL'
4151
rtconfig.BSP_LIBRARY_TYPE = stm32_library
4252

43-
SDK_ROOT = os.path.abspath('./')
53+
# include libraries
54+
objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript')))
4455

4556
# include drivers
46-
objs.extend(SConscript(os.path.dirname(SDK_ROOT) + '/libraries/STM32F7xx_HAL/SConscript'))
47-
48-
# include libraries
49-
objs.extend(SConscript(os.path.dirname(SDK_ROOT) + '/libraries/HAL_Drivers/SConscript'))
57+
objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript')))
5058

5159
# make a building
5260
DoBuilding(TARGET, objs)

0 commit comments

Comments
 (0)