|
108 | 108 | <Error Text="Failed to parse emcc version, and hash from the full version string: '$(_EmccVersionRaw)'" |
109 | 109 | Condition="'$(_EmccVersion)' == '' or '$(_EmccVersionHash)' == ''" /> |
110 | 110 |
|
| 111 | + <ItemGroup> |
| 112 | + <EmccExportedRuntimeMethod Include="FS" /> |
| 113 | + <EmccExportedRuntimeMethod Include="print" /> |
| 114 | + <EmccExportedRuntimeMethod Include="ccall" /> |
| 115 | + <EmccExportedRuntimeMethod Include="cwrap" /> |
| 116 | + <EmccExportedRuntimeMethod Include="setValue" /> |
| 117 | + <EmccExportedRuntimeMethod Include="getValue" /> |
| 118 | + <EmccExportedRuntimeMethod Include="UTF8ToString" /> |
| 119 | + <EmccExportedRuntimeMethod Include="UTF8ArrayToString" /> |
| 120 | + <EmccExportedRuntimeMethod Include="FS_createPath" /> |
| 121 | + <EmccExportedRuntimeMethod Include="FS_createDataFile" /> |
| 122 | + <EmccExportedRuntimeMethod Include="removeRunDependency" /> |
| 123 | + <EmccExportedRuntimeMethod Include="addRunDependency" /> |
| 124 | + <EmccExportedRuntimeMethod Include="FS_readFile" /> |
| 125 | + |
| 126 | + <EmccExportedFunction Include="_malloc" /> |
| 127 | + <EmccExportedFunction Include="_memalign" /> |
| 128 | + <EmccExportedFunction Include="_htons" /> |
| 129 | + <EmccExportedFunction Include="_ntohs" /> |
| 130 | + </ItemGroup> |
| 131 | + <!-- after 3.0 --> |
| 132 | + <ItemGroup Condition="$([MSBuild]::VersionGreaterThan('$(_EmccVersion)', '3.0'))"> |
| 133 | + <EmccExportedFunction Include="_memset" /> |
| 134 | + </ItemGroup> |
| 135 | + <!-- before 3.1.7 see https://github.com/dotnet/runtime/issues/64724 --> |
| 136 | + <ItemGroup Condition="$([MSBuild]::VersionLessThan('$(_EmccVersion)', '3.1.7'))"> |
| 137 | + <EmccExportedFunction Include="__get_daylight" /> |
| 138 | + <EmccExportedFunction Include="__get_timezone" /> |
| 139 | + <EmccExportedFunction Include="__get_tzname" /> |
| 140 | + <EmccExportedFunction Include="g_free" /> |
| 141 | + </ItemGroup> |
| 142 | + <!-- after 3.1.7 --> |
| 143 | + <ItemGroup Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(_EmccVersion)', '3.1.7'))"> |
| 144 | + <EmccExportedFunction Include="stackSave" /> |
| 145 | + <EmccExportedFunction Include="stackRestore" /> |
| 146 | + <EmccExportedFunction Include="stackAlloc" /> |
| 147 | + <EmccExportedFunction Include="_free" /> |
| 148 | + </ItemGroup> |
111 | 149 | <PropertyGroup> |
112 | | - <_DefaultExportedFunctions Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(_EmccVersion)', '3.1.7'))" |
113 | | - >_malloc,stackSave,stackRestore,stackAlloc,_memalign,_memset,_htons,_ntohs,_free</_DefaultExportedFunctions> |
114 | | - |
115 | | - <!-- _htons,_ntohs,__get_daylight,__get_timezone,__get_tzname are exported temporarily, until the issue is fixed in emscripten, https://github.com/dotnet/runtime/issues/64724 --> |
116 | | - <_DefaultExportedFunctions Condition="'$(_DefaultExportedFunctions)' == '' and $([MSBuild]::VersionGreaterThan('$(_EmccVersion)', '3.0'))" |
117 | | - >g_free,_malloc,_memalign,_memset,_htons,_ntohs,__get_daylight,__get_timezone,__get_tzname</_DefaultExportedFunctions> |
118 | | - <_DefaultExportedFunctions Condition="'$(_DefaultExportedFunctions)' == '' and $([MSBuild]::VersionLessThan('$(_EmccVersion)', '3.0'))" |
119 | | - >g_free,_malloc,_htons,_ntohs,__get_daylight,__get_timezone,__get_tzname,_memalign</_DefaultExportedFunctions> |
| 150 | + <_EmccExportedRuntimeMethods>"[@(EmccExportedRuntimeMethod -> '%27%(Identity)%27', ',')]"</_EmccExportedRuntimeMethods> |
| 151 | + <_EmccExportedFunctions>@(EmccExportedFunction -> '%(Identity)',',')</_EmccExportedFunctions> |
120 | 152 | </PropertyGroup> |
121 | | - |
122 | 153 | <ItemGroup> |
123 | 154 | <_EmccCommonFlags Condition="'$(WasmEnableSIMD)' == 'true'" Include="-msimd128" /> |
124 | 155 | <_EmccCommonFlags Condition="'$(MonoWasmThreads)' == 'true'" Include="-s USE_PTHREADS=1" /> |
|
128 | 159 | <_EmccLinkFlags Include="-s ALLOW_MEMORY_GROWTH=1" /> |
129 | 160 | <_EmccLinkFlags Include="-s NO_EXIT_RUNTIME=1" /> |
130 | 161 | <_EmccLinkFlags Include="-s FORCE_FILESYSTEM=1" /> |
131 | | - <_EmccLinkFlags Include="-s EXPORTED_RUNTIME_METHODS="['FS','print','ccall','cwrap','setValue','getValue','UTF8ToString','UTF8ArrayToString','FS_createPath','FS_createDataFile','removeRunDependency','addRunDependency', 'FS_readFile']"" /> |
132 | | - <_EmccLinkFlags Include="-s EXPORTED_FUNCTIONS=$(_DefaultExportedFunctions)" Condition="'$(_DefaultExportedFunctions)' != ''" /> |
| 162 | + <_EmccLinkFlags Include="-s EXPORTED_RUNTIME_METHODS=$(_EmccExportedRuntimeMethods)" /> |
| 163 | + <_EmccLinkFlags Include="-s EXPORTED_FUNCTIONS=$(_EmccExportedFunctions)" /> |
133 | 164 | <_EmccLinkFlags Include="--source-map-base http://example.com" /> |
134 | 165 | <_EmccLinkFlags Include="-s STRICT_JS=1" /> |
135 | 166 | <_EmccLinkFlags Include="-s EXPORT_NAME="'createDotnetRuntime'"" /> |
|
167 | 198 | ], |
168 | 199 | "WasmOptConfigurationFlags": [ |
169 | 200 | { "identity": "WasmOptConfigurationFlags", "value": "$(_WasmOptConfigurationFlags)" } |
170 | | - ] |
| 201 | + ], |
| 202 | + "EmccDefaultExportedFunctions": [@(EmccExportedFunction -> '%22%(Identity)%22', ',')], |
| 203 | + "EmccDefaultExportedRuntimeMethods": [@(EmccExportedRuntimeMethod -> '%22%(Identity)%22', ',')] |
171 | 204 | } |
172 | 205 | } |
173 | 206 | ]]> |
|
0 commit comments