Skip to content

Commit 62cfa8c

Browse files
kaidegitmysterywolf
authored andcommitted
fix missing some flags added in Sconscript
1 parent 2be83d5 commit 62cfa8c

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

tools/cmake.py

+21-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
"""
2-
Utils for CMake
3-
Author: https://github.com./klivelinux
2+
* Copyright (c) 2006-2025 RT-Thread Development Team
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Change Logs:
7+
* Date Author Notes
8+
* 2019-05-24 klivelinux first version
9+
* 2021-04-19 liukangcc add c++ support and libpath
10+
* 2021-06-25 Guozhanxin fix path issue
11+
* 2021-06-30 Guozhanxin add scons --target=cmake-armclang
12+
* 2022-03-16 liukangcc 通过 SCons生成 CMakefile.txt 使用相对路径
13+
* 2022-04-12 mysterywolf rtconfig.CROSS_TOOL->rtconfig.PLATFORM
14+
* 2022-04-29 SunJun8 默认开启生成编译数据库
15+
* 2024-03-18 wirano fix the issue of the missing link flags added in Sconscript
16+
* 2024-07-04 kaidegit Let cmake generator get more param from `rtconfig.py`
17+
* 2024-08-07 imi415 Updated CMake generator handles private macros, using OBJECT and INTERFACE libraries.
18+
* 2024-11-18 kaidegit fix processing groups with similar name
19+
* 2024-11-18 kaidegit fix missing some flags added in Sconscript
420
"""
521

622
import os
@@ -46,12 +62,12 @@ def GenerateCFiles(env, project, project_name):
4662
OBJCOPY = tool_path_conv["CMAKE_OBJCOPY"]["path"]
4763
FROMELF = tool_path_conv["CMAKE_FROMELF"]["path"]
4864

49-
CFLAGS = rtconfig.CFLAGS.replace('\\', "/").replace('\"', "\\\"")
65+
CFLAGS = env['CFLAGS'].replace('\\', "/").replace('\"', "\\\"")
5066
if 'CXXFLAGS' in dir(rtconfig):
51-
CXXFLAGS = rtconfig.CXXFLAGS.replace('\\', "/").replace('\"', "\\\"")
67+
CXXFLAGS = env['CXXFLAGS'].replace('\\', "/").replace('\"', "\\\"")
5268
else:
5369
CXXFLAGS = CFLAGS
54-
AFLAGS = rtconfig.AFLAGS.replace('\\', "/").replace('\"', "\\\"")
70+
AFLAGS = env['ASFLAGS'].replace('\\', "/").replace('\"', "\\\"")
5571
LFLAGS = env['LINKFLAGS'].replace('\\', "/").replace('\"', "\\\"")
5672

5773
POST_ACTION = rtconfig.POST_ACTION

0 commit comments

Comments
 (0)