@@ -15,7 +15,7 @@ list(APPEND NF_CoreCLR_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/src/PAL/Include)
15
15
list (APPEND NF_CoreCLR_INCLUDE_DIRS ${CMAKE_SOURCE_DIR} /src/CLR/CorLib)
16
16
17
17
# CLR startup
18
- list (APPEND NF_CoreCLR_INCLUDE_DIRS ${CMAKE_SOURCE_DIR} /src/CLR/Startup)
18
+ list (APPEND NF_CoreCLR_INCLUDE_DIRS ${CMAKE_SOURCE_DIR} /src/CLR/Startup)
19
19
20
20
# others
21
21
list (APPEND NF_CoreCLR_INCLUDE_DIRS ${CMAKE_SOURCE_DIR} /targets/${RTOS} /_include)
@@ -134,7 +134,7 @@ set(NF_CoreCLR_SRCS
134
134
nf_rt_native_nanoFramework_Runtime_Native_Power.cpp
135
135
nf_rt_native_nanoFramework_Runtime_Native_Rtc_stubs.cpp
136
136
nf_rt_native_System_Environment.cpp
137
-
137
+
138
138
# Core stubs
139
139
RPC_stub.cpp
140
140
@@ -151,9 +151,10 @@ set(NF_CoreCLR_SRCS
151
151
nanoHAL_Time.cpp
152
152
nanoHAL_Watchdog.c
153
153
nanoHAL_SystemEvents.c
154
-
154
+
155
155
# PAL
156
156
nanoPAL_Events.cpp
157
+ nanoPAL_FileSystem_stubs.cpp
157
158
nanoPAL_NativeDouble.cpp
158
159
nanoPAL_Network_stubs.cpp
159
160
nanoPAL_PerformanceCounters_stubs.cpp
@@ -192,15 +193,15 @@ if(NF_FEATURE_SUPPORT_REFLECTION)
192
193
193
194
# should we include binary serialization support?
194
195
if (NF_FEATURE_BINARY_SERIALIZATION)
195
- list (APPEND NF_CoreCLR_SRCS BinaryFormatter.cpp)
196
+ list (APPEND NF_CoreCLR_SRCS BinaryFormatter.cpp)
196
197
else ()
197
198
# binary serialization stubs because we're not supporting reflection
198
- list (APPEND NF_CoreCLR_SRCS BinaryFormatter_stub.cpp)
199
+ list (APPEND NF_CoreCLR_SRCS BinaryFormatter_stub.cpp)
199
200
endif ()
200
201
201
202
else ()
202
203
# binary serialization stubs because we're not supporting reflection
203
- list (APPEND NF_CoreCLR_SRCS BinaryFormatter_stub.cpp)
204
+ list (APPEND NF_CoreCLR_SRCS BinaryFormatter_stub.cpp)
204
205
endif ()
205
206
206
207
# include Collection support files depending on build option
@@ -209,7 +210,14 @@ if(API_nanoFramework.System.Collections)
209
210
list (APPEND NF_CoreCLR_SRCS CLR_RT_HeapBlock_Stack.cpp)
210
211
endif ()
211
212
212
- # need a conditional include because of ESP32 building network as a library
213
+ # file system support?
214
+ if (API_System.IO.FileSystem)
215
+ list (APPEND NF_CoreCLR_SRCS FileStream.cpp)
216
+ else ()
217
+ list (APPEND NF_CoreCLR_SRCS FileStream_stub.cpp)
218
+ endif ()
219
+
220
+ # need a conditional include because of ESP32 building network as a library
213
221
if (NOT USE_SECURITY_MBEDTLS_OPTION)
214
222
list (APPEND NF_CoreCLR_SRCS base64.c)
215
223
endif ()
@@ -229,103 +237,100 @@ if(EXISTS ${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES}/nanoFramework.Runtime.Native/
229
237
endif ()
230
238
231
239
foreach (SRC_FILE ${NF_CoreCLR_SRCS} )
232
-
233
240
set (NF_CoreCLR_SRC_FILE SRC_FILE-NOTFOUND )
234
241
235
242
find_file (NF_CoreCLR_SRC_FILE ${SRC_FILE}
236
- PATHS
237
-
238
- # Core
239
- ${CMAKE_SOURCE_DIR} /src/CLR/Core
240
-
241
- # CoreLib
242
- ${CMAKE_SOURCE_DIR} /src/CLR/CorLib
243
-
244
- # CLR startup
245
- ${CMAKE_SOURCE_DIR} /src/CLR/Startup
246
-
247
- # Runtime.Native
248
- ${CMAKE_SOURCE_DIR} /src/nanoFramework.Runtime.Native
249
-
250
- # Core stubs
251
- ${CMAKE_SOURCE_DIR} /src/CLR/Core/Hardware
252
- ${CMAKE_SOURCE_DIR} /src/CLR/Core/InterruptHandler
253
- ${CMAKE_SOURCE_DIR} /src/CLR/Core/NativeEventDispatcher
254
- ${CMAKE_SOURCE_DIR} /src/CLR/Core/RPC
255
- ${CMAKE_SOURCE_DIR} /src/CLR/Core/Serialization
256
-
257
- # CLR stubs
258
- ${CMAKE_SOURCE_DIR} /src/CLR/Debugger
259
- ${CMAKE_SOURCE_DIR} /src/CLR/Diagnostics
260
- ${CMAKE_SOURCE_DIR} /src/CLR/Messaging
261
-
262
- # Helpers
263
- ${CMAKE_SOURCE_DIR} /src/CLR/Helpers/nanoprintf
264
- ${CMAKE_SOURCE_DIR} /src/CLR/Helpers/NanoRingBuffer
265
- ${CMAKE_SOURCE_DIR} /src/CLR/Helpers/Base64
266
- ${CMAKE_SOURCE_DIR} /src/CLR/Diagnostics
267
-
268
- # HAL
269
- ${CMAKE_SOURCE_DIR} /src/HAL
270
-
271
- # PAL
272
- ${CMAKE_SOURCE_DIR} /src/PAL
273
- ${CMAKE_SOURCE_DIR} /src/PAL/BlockStorage
274
- ${CMAKE_SOURCE_DIR} /src/PAL/Double
275
- ${CMAKE_SOURCE_DIR} /src/PAL/Events
276
-
277
- # PAL stubs
278
- ${CMAKE_SOURCE_DIR} /src/PAL/AsyncProcCall
279
- ${CMAKE_SOURCE_DIR} /src/PAL/COM
280
- ${CMAKE_SOURCE_DIR} /src/PAL/Profiler
281
-
282
- # platform specific implementations
283
- ${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES} /nanoFramework.Runtime.Native
284
-
285
- # target
286
- ${TARGET_BASE_LOCATION}
243
+ PATHS
244
+
245
+ # Core
246
+ ${CMAKE_SOURCE_DIR} /src/CLR/Core
247
+
248
+ # CoreLib
249
+ ${CMAKE_SOURCE_DIR} /src/CLR/CorLib
250
+
251
+ # CLR startup
252
+ ${CMAKE_SOURCE_DIR} /src/CLR/Startup
253
+
254
+ # Runtime.Native
255
+ ${CMAKE_SOURCE_DIR} /src/nanoFramework.Runtime.Native
256
+
257
+ # Core stubs
258
+ ${CMAKE_SOURCE_DIR} /src/CLR/Core/Hardware
259
+ ${CMAKE_SOURCE_DIR} /src/CLR/Core/InterruptHandler
260
+ ${CMAKE_SOURCE_DIR} /src/CLR/Core/NativeEventDispatcher
261
+ ${CMAKE_SOURCE_DIR} /src/CLR/Core/RPC
262
+ ${CMAKE_SOURCE_DIR} /src/CLR/Core/Serialization
263
+ ${CMAKE_SOURCE_DIR} /src/CLR/Core/FileStream
264
+
265
+ # CLR stubs
266
+ ${CMAKE_SOURCE_DIR} /src/CLR/Debugger
267
+ ${CMAKE_SOURCE_DIR} /src/CLR/Diagnostics
268
+ ${CMAKE_SOURCE_DIR} /src/CLR/Messaging
269
+
270
+ # Helpers
271
+ ${CMAKE_SOURCE_DIR} /src/CLR/Helpers/nanoprintf
272
+ ${CMAKE_SOURCE_DIR} /src/CLR/Helpers/NanoRingBuffer
273
+ ${CMAKE_SOURCE_DIR} /src/CLR/Helpers/Base64
274
+ ${CMAKE_SOURCE_DIR} /src/CLR/Diagnostics
275
+
276
+ # HAL
277
+ ${CMAKE_SOURCE_DIR} /src/HAL
278
+
279
+ # PAL
280
+ ${CMAKE_SOURCE_DIR} /src/PAL
281
+ ${CMAKE_SOURCE_DIR} /src/PAL/BlockStorage
282
+ ${CMAKE_SOURCE_DIR} /src/PAL/Double
283
+ ${CMAKE_SOURCE_DIR} /src/PAL/Events
284
+ ${CMAKE_SOURCE_DIR} /src/PAL/FileSystem
285
+
286
+ # PAL stubs
287
+ ${CMAKE_SOURCE_DIR} /src/PAL/AsyncProcCall
288
+ ${CMAKE_SOURCE_DIR} /src/PAL/COM
289
+ ${CMAKE_SOURCE_DIR} /src/PAL/Profiler
290
+
291
+ # platform specific implementations
292
+ ${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES} /nanoFramework.Runtime.Native
293
+
294
+ # target
295
+ ${TARGET_BASE_LOCATION}
287
296
288
297
CMAKE_FIND_ROOT_PATH_BOTH
289
298
)
290
299
291
- if (BUILD_VERBOSE)
300
+ if (BUILD_VERBOSE)
292
301
message ("${SRC_FILE} >> ${NF_CoreCLR_SRC_FILE} " )
293
302
endif ()
294
303
295
304
list (APPEND NF_CoreCLR_SOURCES ${NF_CoreCLR_SRC_FILE} )
296
-
297
305
endforeach ()
298
306
299
307
include (FindPackageHandleStandardArgs)
300
308
301
309
FIND_PACKAGE_HANDLE_STANDARD_ARGS(NF_CoreCLR DEFAULT_MSG NF_CoreCLR_INCLUDE_DIRS NF_CoreCLR_SOURCES)
302
310
303
-
304
311
# macro to be called from binutils to add Core CLR library
305
312
# optional EXTRA_INCLUDES with include paths to be added to the library
306
313
# optional EXTRA_COMPILE_DEFINITIONS with compiler definitions to be added to the library
307
314
macro (nf_add_lib_coreclr)
308
-
309
315
# parse arguments
310
316
cmake_parse_arguments (NFALC "" "" "EXTRA_INCLUDES;EXTRA_COMPILE_DEFINITIONS" ${ARGN} )
311
317
312
318
# add this has a library
313
319
set (LIB_NAME NF_CoreCLR)
314
320
315
321
add_library (
316
- ${LIB_NAME} STATIC
317
- ${NF_CoreCLR_SOURCES}
318
- ${NF_Diagnostics_SOURCES} )
322
+ ${LIB_NAME} STATIC
323
+ ${NF_CoreCLR_SOURCES}
324
+ ${NF_Diagnostics_SOURCES} )
319
325
320
326
target_include_directories (
321
- ${LIB_NAME}
322
- PUBLIC
323
- ${NF_CoreCLR_INCLUDE_DIRS}
324
- ${NFALC_EXTRA_INCLUDES} )
327
+ ${LIB_NAME}
328
+ PUBLIC
329
+ ${NF_CoreCLR_INCLUDE_DIRS}
330
+ ${NFALC_EXTRA_INCLUDES} )
325
331
326
332
# TODO can be removed later
327
333
if (RTOS_ESP32_CHECK)
328
-
329
334
nf_common_compiler_definitions(TARGET ${LIB_NAME} BUILD_TARGET ${NANOCLR_PROJECT_NAME} )
330
335
331
336
# this is the only one different
@@ -335,13 +340,12 @@ macro(nf_add_lib_coreclr)
335
340
${NFALC_EXTRA_COMPILER_DEFINITIONS}
336
341
)
337
342
338
- else ()
343
+ else ()
339
344
nf_set_compile_options(TARGET ${LIB_NAME} )
340
345
nf_set_compile_definitions(TARGET ${LIB_NAME} EXTRA_COMPILE_DEFINITIONS ${NFALC_EXTRA_COMPILE_DEFINITIONS} BUILD_TARGET ${NANOCLR_PROJECT_NAME} )
341
346
nf_set_link_options(TARGET ${LIB_NAME} )
342
347
endif ()
343
348
344
349
# add alias
345
350
add_library ("nano::${LIB_NAME} " ALIAS ${LIB_NAME} )
346
-
347
351
endmacro ()
0 commit comments