Skip to content

Commit 6a0e343

Browse files
authored
Merge pull request #81 from jsturtevant/fix-wit-additional-args
Don't overwrite the WitBindgenAddtionalArgs
2 parents 3b84d02 + 735a75c commit 6a0e343

File tree

6 files changed

+15
-2
lines changed

6 files changed

+15
-2
lines changed

src/WitBindgen/build/BytecodeAlliance.Componentize.DotNet.WitBindgen.targets

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<Project>
22
<PropertyGroup>
33
<WitBindgenRuntime>native-aot</WitBindgenRuntime>
4-
<WitBindgenAddtionalArgs></WitBindgenAddtionalArgs>
54

65
<!-- Keep this block all in sync manually, since URLs can be arbitrary -->
76
<WasiSdkVersion>24.0</WasiSdkVersion>

test/E2ETest/testapps/E2EConsumer/E2EConsumer.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<UseAppHost>false</UseAppHost>
1515
<PublishTrimmed>true</PublishTrimmed>
1616
<TargetName>e2econsumer</TargetName>
17+
<WitBindgenAddtionalArgs>--features float-add</WitBindgenAddtionalArgs>
1718
</PropertyGroup>
1819

1920
<ItemGroup>

test/E2ETest/testapps/E2EConsumer/Program.cs

+5
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@
55

66
var result = OperationsInterop.Add(123, 456);
77
Console.WriteLine($"123 + 456 = {result}");
8+
9+
// this is just here to make sure we can enable features and pass flags via WitBindgenAddtionalArgs
10+
// the fact that it compiles is enough to test this worked.
11+
var floatResult = OperationsInterop.AddFloat(1.1f, 1.2f);
12+
Console.WriteLine($"1.1 + 1.2 = {floatResult}");

test/E2ETest/testapps/E2EProducer/E2EProducer.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<RuntimeIdentifier>wasi-wasm</RuntimeIdentifier>
1313
<PublishTrimmed>true</PublishTrimmed>
1414
<TargetName>e2eproducer</TargetName>
15+
<WitBindgenAddtionalArgs>--features float-add</WitBindgenAddtionalArgs>
1516
</PropertyGroup>
1617

1718
<ItemGroup>

test/E2ETest/testapps/E2EProducer/OperationsImpl.cs

+5
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@ public static int Add(int left, int right)
66
{
77
return left + right;
88
}
9+
10+
public static float AddFloat(float left, float right)
11+
{
12+
return left + right;
13+
}
914
}

test/E2ETest/testapps/E2EProducer/producer-consumer.wit

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package test:producer-consumer;
22

33
interface operations {
4-
add: func(left: s32, right: s32) -> s32;
4+
add: func(left: s32, right: s32) -> s32;
5+
@unstable(feature = float-add)
6+
add-float: func(a: f32, b: f32) -> f32;
57
}
68

79
world producer {

0 commit comments

Comments
 (0)