Skip to content

[tools][cmake] get some info from env to save time #10062

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tools/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
* 2024-07-04 kaidegit Let cmake generator get more param from `rtconfig.py`
* 2024-08-07 imi415 Updated CMake generator handles private macros, using OBJECT and INTERFACE libraries.
* 2024-11-18 kaidegit fix processing groups with similar name
* 2024-11-18 kaidegit fix missing some flags added in Sconscript
* 2025-02-22 kaidegit fix missing some flags added in Sconscript
* 2025-02-24 kaidegit remove some code that is unnecessary but takes time, get them from env
"""

import os
Expand All @@ -32,7 +33,6 @@ def GenerateCFiles(env, project, project_name):
"""
Generate CMakeLists.txt files
"""
info = utils.ProjectInfo(env)

PROJECT_NAME = project_name if project_name != "project" else "rtthread"

Expand Down Expand Up @@ -177,14 +177,14 @@ def GenerateCFiles(env, project, project_name):
cm_file.write('\n')

cm_file.write("INCLUDE_DIRECTORIES(\n")
for i in info['CPPPATH']:
for i in env['CPPPATH']:
# use relative path
path = _make_path_relative(os.getcwd(), i)
cm_file.write( "\t" + path.replace("\\", "/") + "\n")
cm_file.write(")\n\n")

cm_file.write("ADD_DEFINITIONS(\n")
for i in info['CPPDEFINES']:
for i in env['CPPDEFINES']:
cm_file.write("\t-D" + i + "\n")
cm_file.write(")\n\n")

Expand Down