Skip to content

Commit ffa9cb6

Browse files
authored
Creation of CLR_IncludedAPI.h (#3148)
***NO_CI***
1 parent ac009d5 commit ffa9cb6

File tree

5 files changed

+50
-4
lines changed

5 files changed

+50
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
# ignore any content inside the Interop assemblies folder
1515
InteropAssemblies/*
16+
!InteropAssemblies/CLR_IncludedAPI.h.in
1617
!InteropAssemblies/CLR_RT_InteropAssembliesTable.cpp.in
1718
!InteropAssemblies/README.md
1819

CMake/Modules/FindNF_NativeAssemblies.cmake

+8-1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ macro(PerformSettingsForApiEntry apiNamespace)
118118
# list this option
119119
list(APPEND apiListing "${apiNamespace}")
120120

121+
# append to list of defines for Interop Assemblies include file
122+
set(CLR_RT_NativeAssemblyPreprocessorDefines "${CLR_RT_NativeAssemblyPreprocessorDefines}\n#define API_${apiNamespaceWithoutDots}")
123+
121124
# append to list of declaration for Interop Assemblies table
122125
list(APPEND CLR_RT_NativeAssemblyDataList "extern const CLR_RT_NativeAssemblyData g_CLR_AssemblyNative_${apiNamespaceWithoutDots};")
123126

@@ -470,10 +473,14 @@ string(REPLACE ";" "\n " CLR_RT_NativeAssemblyDataTableEntries "${CLR_RT_Nati
470473
list(LENGTH CLR_RT_NativeAssemblyDataTableEntriesList CLR_RT_NativeAssembliesCount)
471474

472475

476+
# configure header file with Interop Assemblies defines and...
477+
configure_file("${CMAKE_SOURCE_DIR}/InteropAssemblies/CLR_IncludedAPI.h.in"
478+
"${CMAKE_CURRENT_BINARY_DIR}/CLR_IncludedAPI.h" @ONLY)
479+
473480
# configure code file with Interop Assemblies table and...
474481
configure_file("${CMAKE_SOURCE_DIR}/InteropAssemblies/CLR_RT_InteropAssembliesTable.cpp.in"
475482
"${CMAKE_CURRENT_BINARY_DIR}/CLR_RT_InteropAssembliesTable.cpp" @ONLY)
476-
# ... now add Interop Assemblies table to ChibiOS nanoCLR sources list
483+
# ... now add Interop Assemblies table to nanoCLR sources list
477484
list(APPEND NF_NativeAssemblies_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/CLR_RT_InteropAssembliesTable.cpp")
478485

479486
# create a .csv file with native assembly versions in the output directory
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//
2+
// Copyright (c) .NET Foundation and Contributors
3+
// See LICENSE file in the project root for full license information.
4+
//
5+
6+
//////////////////////////////////////////////////////////////////////////////
7+
// This file was automatically generated by a tool. //
8+
// Any changes you make here will be overwritten when it's generated again. //
9+
//////////////////////////////////////////////////////////////////////////////
10+
11+
#ifndef _CLR_INCLUDEDAPI_H_
12+
#define _CLR_INCLUDEDAPI_H_
13+
@CLR_RT_NativeAssemblyPreprocessorDefines@
14+
15+
#endif // _CLR_INCLUDEDAPI_H_

InteropAssemblies/README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

2-
This folder contains the configuration file for the Assemblies Table collection.
2+
This folder contains a template for a header with preprocessor defines and
3+
for the configuration file for the Assemblies Table collection.
34

4-
It's a placeholder for the Interop assemblies source files.
5-
The source files for each Interop assembly should be placed in it's own folder.
5+
The latter is a placeholder for the Interop assemblies source files.
6+
The source files for each Interop assembly should be placed in its own folder.
67
Anything inside this folder is ignored by an exception pattern in .gitignore file.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//
2+
// Copyright (c) .NET Foundation and Contributors
3+
// See LICENSE file in the project root for full license information.
4+
//
5+
6+
#ifndef _CLR_INCLUDEDAPI_H_
7+
#define _CLR_INCLUDEDAPI_H_
8+
9+
#define API_nanoFramework_Networking_Sntp
10+
#define API_nanoFramework_ResourceManager
11+
#define API_nanoFramework_System_Collections
12+
#define API_nanoFramework_System_Text
13+
#define API_nanoFramework_Runtime_Events
14+
#define API_System_Math
15+
#define API_System_Net
16+
#define API_System_Device_Gpio
17+
#define API_System_Device_I2c
18+
#define API_System_IO_Ports
19+
#define API_System_Device_Spi
20+
#define API_System_Runtime_Serialization
21+
22+
#endif // _CLR_INCLUDEDAPI_H_

0 commit comments

Comments
 (0)