@@ -27,26 +27,31 @@ See the LICENSE file in the project root for more information.
2727 <PropertyGroup >
2828 <NativeObjectExt Condition =" '$(TargetOS)' == 'Windows_NT'" >.obj</NativeObjectExt >
2929 <NativeObjectExt Condition =" '$(TargetOS)' != 'Windows_NT'" >.o</NativeObjectExt >
30+ <NativeObjectExt Condition =" '$(NativeCodeGen)' == 'wasm'" >.bc</NativeObjectExt >
3031 <LibFileExt Condition =" '$(TargetOS)' == 'Windows_NT'" >.lib</LibFileExt >
3132 <LibFileExt Condition =" '$(TargetOS)' != 'Windows_NT'" >.a</LibFileExt >
3233
3334 <IlcOutputFileExt >$(NativeObjectExt)</IlcOutputFileExt >
3435 <IlcOutputFileExt Condition =" $(NativeCodeGen) == 'cpp'" >.cpp</IlcOutputFileExt >
36+ <IlcOutputFileExt Condition =" '$(NativeCodeGen)' == 'wasm'" >.bc</IlcOutputFileExt >
3537
3638
3739 <NativeBinaryExt Condition =" '$(OutputType)' == 'Exe' and '$(TargetOS)' == 'Windows_NT'" >.exe</NativeBinaryExt >
3840 <NativeBinaryExt Condition =" '$(OutputType)' == 'Exe' and '$(TargetOS)' != 'Windows_NT'" ></NativeBinaryExt >
3941 <NativeBinaryExt Condition =" '$(OutputType)' != 'Exe' and '$(TargetOS)' == 'Windows_NT'" >.dll</NativeBinaryExt >
4042 <NativeBinaryExt Condition =" '$(OutputType)' != 'Exe' and '$(TargetOS)' == 'OSX'" >.dylib</NativeBinaryExt >
4143 <NativeBinaryExt Condition =" '$(OutputType)' != 'Exe' and '$(TargetOS)' != 'Windows_NT' and '$(TargetOS)' != 'OSX'" >.so</NativeBinaryExt >
44+ <NativeBinaryExt Condition =" '$(NativeCodeGen)' == 'wasm'" >.html</NativeBinaryExt >
4245
4346 <NativeObject >$(NativeIntermediateOutputPath)$(TargetName)$(NativeObjectExt)</NativeObject >
4447 <NativeBinary >$(NativeOutputPath)$(TargetName)$(NativeBinaryExt)</NativeBinary >
4548
4649 <IlcCompileOutput Condition =" $(NativeCodeGen) == ''" >$(NativeObject)</IlcCompileOutput >
4750 <IlcCompileOutput Condition =" $(NativeCodeGen) == 'cpp'" >$(NativeIntermediateOutputPath)$(TargetName).cpp</IlcCompileOutput >
51+
4852 <LinkNativeDependsOn Condition =" $(NativeCodeGen) == ''" >IlcCompile</LinkNativeDependsOn >
4953 <LinkNativeDependsOn Condition =" $(NativeCodeGen) == 'cpp'" >CppCompile</LinkNativeDependsOn >
54+ <LinkNativeDependsOn Condition =" $(NativeCodeGen) == 'wasm'" >IlcCompile</LinkNativeDependsOn >
5055
5156 <FrameworkLibPath Condition =" '$(FrameworkLibPath)' == ''" >$(NativeOutputPath)</FrameworkLibPath >
5257 <FrameworkObjPath Condition =" '$(FrameworkObjPath)' == ''" >$(NativeIntermediateOutputPath)</FrameworkObjPath >
@@ -131,7 +136,7 @@ See the LICENSE file in the project root for more information.
131136 <WriteLinesToFile File =" $(NativeIntermediateOutputPath)cl.rsp" Lines =" @(CompilerArg)" Overwrite =" true" Condition =" '$(OS)' == 'Windows_NT'" />
132137 <Exec Command =" $(CppCompiler) @" $(NativeIntermediateOutputPath)cl.rsp" " Condition =" '$(OS)' == 'Windows_NT'" />
133138 </Target >
134-
139+
135140 <Target Name =" LinkNative"
136141 Inputs =" $(NativeObject);@(NativeLibrary)"
137142 Outputs =" $(NativeBinary)"
@@ -147,7 +152,10 @@ See the LICENSE file in the project root for more information.
147152 <MakeDir Directories =" $([System.IO.Path]::GetDirectoryName($(NativeBinary)))" />
148153 <Exec Command =" $(CppLinker) @(CustomLinkerArg, ' ')" Condition =" '$(OS)' != 'Windows_NT'" />
149154 <WriteLinesToFile File =" $(NativeIntermediateOutputPath)link.rsp" Lines =" @(CustomLinkerArg)" Overwrite =" true" Condition =" '$(OS)' == 'Windows_NT'" />
150- <Exec Command =" $(CppLinker) @" $(NativeIntermediateOutputPath)link.rsp" " Condition =" '$(OS)' == 'Windows_NT'" />
155+ <Exec Command =" $(CppLinker) @" $(NativeIntermediateOutputPath)link.rsp" " Condition =" '$(OS)' == 'Windows_NT' and '$(NativeCodeGen)' != 'wasm'" />
156+ <Exec Command =" " $(EMSCRIPTEN)\emcc.bat" " $(NativeObject)" -o " $(NativeBinary)" -s WASM=1" Condition =" '$(NativeCodeGen)' == 'wasm' and '$(EMSCRIPTEN)' != ''" />
157+ <Message Text =" Emscripten not found, not linking WebAssembly. To enable WebAssembly linking, install Emscripten and ensure the EMSCRIPTEN environment variable points to the directory containing emcc.bat"
158+ Condition =" '$(NativeCodeGen)' == 'wasm' and '$(EMSCRIPTEN)' == ''" />
151159 </Target >
152160
153161 <Target Name =" CreateLib"
0 commit comments