Skip to content
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
3 changes: 2 additions & 1 deletion tools/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ def GenerateCFiles(env, project, project_name):

CFLAGS = env['CFLAGS'].replace('\\', "/").replace('\"', "\\\"")
if 'CXXFLAGS' in dir(rtconfig):
CXXFLAGS = env['CXXFLAGS'].replace('\\', "/").replace('\"', "\\\"")
cflag_str=''.join(env['CXXFLAGS'])
Copy link

Copilot AI Apr 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of ''.join() assumes that env['CXXFLAGS'] is an iterable of strings. If env['CXXFLAGS'] is already a string, this can lead to unexpected behavior. Consider validating the type before joining or using a type conversion method that properly handles both strings and lists.

Suggested change
cflag_str=''.join(env['CXXFLAGS'])
if isinstance(env['CXXFLAGS'], str):
cflag_str = env['CXXFLAGS']
else:
cflag_str = ''.join(env['CXXFLAGS'])

Copilot uses AI. Check for mistakes.
CXXFLAGS = cflag_str.replace('\\', "/").replace('\"', "\\\"")
else:
CXXFLAGS = CFLAGS
AFLAGS = env['ASFLAGS'].replace('\\', "/").replace('\"', "\\\"")
Expand Down