File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 88import re
99import utils
1010import rtconfig
11+ from utils import _make_path_relative
1112
1213
1314def GenerateCFiles (env ,project ):
@@ -106,7 +107,9 @@ def GenerateCFiles(env,project):
106107
107108 cm_file .write ("INCLUDE_DIRECTORIES(\n " )
108109 for i in info ['CPPPATH' ]:
109- cm_file .write ( "\t " + i .replace ("\\ " , "/" ) + "\n " )
110+ # use relative path
111+ path = _make_path_relative (os .getcwd (), i )
112+ cm_file .write ( "\t " + path .replace ("\\ " , "/" ) + "\n " )
110113 cm_file .write (")\n \n " )
111114
112115 cm_file .write ("ADD_DEFINITIONS(\n " )
@@ -117,7 +120,9 @@ def GenerateCFiles(env,project):
117120 cm_file .write ("SET(PROJECT_SOURCES\n " )
118121 for group in project :
119122 for f in group ['src' ]:
120- cm_file .write ( "\t " + os .path .normpath (f .rfile ().abspath ).replace ("\\ " , "/" ) + "\n " )
123+ # use relative path
124+ path = _make_path_relative (os .getcwd (), os .path .normpath (f .rfile ().abspath ))
125+ cm_file .write ( "\t " + path .replace ("\\ " , "/" ) + "\n " )
121126 cm_file .write (")\n \n " )
122127
123128 if rtconfig .PLATFORM == 'gcc' :
Original file line number Diff line number Diff line change 2929import json
3030import utils
3131import rtconfig
32+ import rtconfig
33+ from utils import _make_path_relative
34+
3235
3336def GenerateCFiles (env ):
3437 """
@@ -56,9 +59,9 @@ def GenerateCFiles(env):
5659 includePath = []
5760 for i in info ['CPPPATH' ]:
5861 if i [0 ] == '\" ' and i [len (i ) - 2 :len (i )] == '\" ,' :
59- includePath .append (i [1 :len (i ) - 2 ])
62+ includePath .append (_make_path_relative ( os . getcwd (), i [1 :len (i ) - 2 ]) )
6063 else :
61- includePath .append (i )
64+ includePath .append (_make_path_relative ( os . getcwd (), i ) )
6265 config_obj ['includePath' ] = includePath
6366
6467 json_obj = {}
You can’t perform that action at this time.
0 commit comments