Skip to content

Commit 7626347

Browse files
committed
Embed native SDK into C# SDK NuGet pacakge
1 parent 3b935bd commit 7626347

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,12 @@ add_custom_target(
2828
sdk_nuget_package ALL
2929
dotnet pack
3030
-c ${DOTNET_CONFIGURATION}
31+
"\"-p:ConstraintSDKPath=${CMAKE_CURRENT_BINARY_DIR}/sdk/install\""
3132
"\"${CMAKE_CURRENT_SOURCE_DIR}/csharp/ConstraintSDK.csproj\""
3233
)
3334

35+
add_dependencies(sdk_nuget_package sdk)
36+
3437
ExternalProject_Add(
3538
bare_wasm_cpp
3639
PREFIX examples/bare_wasm_cpp
@@ -75,11 +78,10 @@ if(NOT "${NATIVEAOT_ROOT}" STREQUAL "")
7578
-c ${DOTNET_CONFIGURATION}
7679
-p:Platform=wasm
7780
"\"-p:EMSDK=${EMSDK}\""
78-
"\"-p:ConstraintSDKPath=${CMAKE_CURRENT_BINARY_DIR}/sdk/install\""
7981
"\"${CMAKE_CURRENT_SOURCE_DIR}/examples/emscripten_csharp/Example.csproj\""
8082
)
8183

82-
add_dependencies(emscripten_csharp sdk sdk_nuget_package)
84+
add_dependencies(emscripten_csharp sdk_nuget_package)
8385

8486
add_dependencies(examples emscripten_csharp)
8587
endif()

csharp/ConstraintSDK.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<Content Include="build/*">
9+
<Content Include="build/**/*">
1010
<PackagePath>build</PackagePath>
1111
</Content>
12+
<Content Include="$(ConstraintSDKPath)/**/*">
13+
<PackagePath>build/sdk</PackagePath>
14+
</Content>
1215
</ItemGroup>
1316

1417
</Project>

csharp/build/ConstraintSDK.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22

33
<PropertyGroup>
4+
<ConstraintSDKPath>$(MSBuildThisFileDirectory)/sdk</ConstraintSDKPath>
5+
46
<EmccExtraArgs Condition="'$(RuntimeIdentifier)' == 'browser-wasm'">$(EmccExtraArgs) $(ConstraintSDKPath)/lib/wasm32-emscripten/libsolver.a --js-library $(ConstraintSDKPath)/lib/system_controls_emscripten.js -s NO_EXIT_RUNTIME -s EXTRA_EXPORTED_RUNTIME_METHODS=["ccall"] -s EXPORTED_FUNCTIONS=["_main","_button_press_handler","_frame_resize_handler","_text_input_change_handler"]</EmccExtraArgs>
57
</PropertyGroup>
68

0 commit comments

Comments
 (0)