|
1 | 1 | """
|
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 |
4 | 20 | """
|
5 | 21 |
|
6 | 22 | import os
|
@@ -46,12 +62,12 @@ def GenerateCFiles(env, project, project_name):
|
46 | 62 | OBJCOPY = tool_path_conv["CMAKE_OBJCOPY"]["path"]
|
47 | 63 | FROMELF = tool_path_conv["CMAKE_FROMELF"]["path"]
|
48 | 64 |
|
49 |
| - CFLAGS = rtconfig.CFLAGS.replace('\\', "/").replace('\"', "\\\"") |
| 65 | + CFLAGS = env['CFLAGS'].replace('\\', "/").replace('\"', "\\\"") |
50 | 66 | if 'CXXFLAGS' in dir(rtconfig):
|
51 |
| - CXXFLAGS = rtconfig.CXXFLAGS.replace('\\', "/").replace('\"', "\\\"") |
| 67 | + CXXFLAGS = env['CXXFLAGS'].replace('\\', "/").replace('\"', "\\\"") |
52 | 68 | else:
|
53 | 69 | CXXFLAGS = CFLAGS
|
54 |
| - AFLAGS = rtconfig.AFLAGS.replace('\\', "/").replace('\"', "\\\"") |
| 70 | + AFLAGS = env['ASFLAGS'].replace('\\', "/").replace('\"', "\\\"") |
55 | 71 | LFLAGS = env['LINKFLAGS'].replace('\\', "/").replace('\"', "\\\"")
|
56 | 72 |
|
57 | 73 | POST_ACTION = rtconfig.POST_ACTION
|
|
0 commit comments