@@ -33,6 +33,17 @@ def OsEnv(self):
33
33
else :
34
34
raise Exception ('Unknown OS type: %r' % self )
35
35
36
+ class NxpBS (Enum ):
37
+ GN = auto ()
38
+ CMAKE = auto ()
39
+
40
+ def BuildSystem (self ):
41
+ if self == NxpBS .GN :
42
+ return 'gn'
43
+ elif self == NxpBS .CMAKE :
44
+ return 'cmake'
45
+ else :
46
+ raise Exception ('Unknown build system: %r' % self )
36
47
37
48
class NxpBoard (Enum ):
38
49
K32W0 = auto ()
@@ -113,6 +124,7 @@ def __init__(self,
113
124
app : NxpApp = NxpApp .LIGHTING ,
114
125
board : NxpBoard = NxpBoard .K32W0 ,
115
126
os_env : NxpOsUsed = NxpOsUsed .FREERTOS ,
127
+ build_system : NxpBS = NxpBS .GN ,
116
128
low_power : bool = False ,
117
129
smu2 : bool = False ,
118
130
enable_factory_data : bool = False ,
@@ -136,6 +148,7 @@ def __init__(self,
136
148
self .app = app
137
149
self .board = board
138
150
self .os_env = os_env
151
+ self .build_system = build_system
139
152
self .low_power = low_power
140
153
self .smu2 = smu2
141
154
self .enable_factory_data = enable_factory_data
@@ -205,6 +218,7 @@ def GnBuildArgs(self):
205
218
206
219
def CmakeBuildFlags (self ):
207
220
flags = []
221
+
208
222
if self .enable_factory_data :
209
223
if self .os_env == NxpOsUsed .ZEPHYR :
210
224
flags .append ('-DFILE_SUFFIX=fdata' )
@@ -283,7 +297,7 @@ def generate(self):
283
297
elif p .sdk_name == 'common' :
284
298
cmd += 'export NXP_SDK_ROOT="' + str (p .sdk_storage_location_abspath ) + '" \n '
285
299
286
- if self .board == NxpBoard . RW61X :
300
+ if self .build_system == NxpBS . CMAKE :
287
301
cmd += '''
288
302
cmake -GNinja {build_flags} -H{example_folder} -B{out_folder}
289
303
''' .format (
@@ -292,7 +306,7 @@ def generate(self):
292
306
out_folder = self .output_dir ).strip ()
293
307
self ._Execute (['bash' , '-c' , cmd ], title = 'Generating ' + self .identifier )
294
308
295
- else :
309
+ elif self . build_system == NxpBS . GN :
296
310
# add empty space at the end to avoid concatenation issue when there is no --args
297
311
cmd += 'gn gen --check --fail-on-unused-args --export-compile-commands --root=%s ' % self .root
298
312
0 commit comments