|
| 1 | +<Project> |
| 2 | + |
| 3 | + <ImportProject="..\..\build-tools\scripts\NativeToolchain.targets" /> |
| 4 | + |
| 5 | + <PropertyGroup> |
| 6 | + <_JavaInteropLibNameCondition=" $([MSBuild]::IsOSPlatform ('osx')) ">libjava-interop.dylib</_JavaInteropLibName> |
| 7 | + <_JavaInteropLibNameCondition=" $([MSBuild]::IsOSPlatform ('linux')) ">libjava-interop.so</_JavaInteropLibName> |
| 8 | + <_JavaInteropLibNameCondition=" $([MSBuild]::IsOSPlatform ('windows')) ">java-interop.dll</_JavaInteropLibName> |
| 9 | + </PropertyGroup> |
| 10 | + |
| 11 | + <ItemGroupCondition=" $([MSBuild]::IsOSPlatform ('windows')) "> |
| 12 | + <_JavaInteropNativeLibInclude="CMakeLists.txt"> |
| 13 | + <Arch>x86_amd64</Arch> |
| 14 | + <Dir>win-x64\</Dir> |
| 15 | + </_JavaInteropNativeLib> |
| 16 | + <_JavaInteropNativeLibInclude="CMakeLists.txt"> |
| 17 | + <Arch>x86</Arch> |
| 18 | + <Dir>win-x86\</Dir> |
| 19 | + </_JavaInteropNativeLib> |
| 20 | + </ItemGroup> |
| 21 | + |
| 22 | + <ItemGroupCondition=" !$([MSBuild]::IsOSPlatform ('windows')) "> |
| 23 | + <_JavaInteropNativeLibInclude="CMakeLists.txt" /> |
| 24 | + </ItemGroup> |
| 25 | + |
| 26 | + <ItemGroup> |
| 27 | + <NoneInclude="@(_JavaInteropNativeLib->'$(OutputPath)%(Dir)$(_JavaInteropLibName)')"> |
| 28 | + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
| 29 | + <Link>%(Dir)$(_JavaInteropLibName)</Link> |
| 30 | + </None> |
| 31 | + </ItemGroup> |
| 32 | + |
| 33 | + <ItemGroup> |
| 34 | + <ClIncludeInclude="*.h" /> |
| 35 | + </ItemGroup> |
| 36 | + |
| 37 | + <ItemGroup> |
| 38 | + <ClCompileInclude="$(IntermediateOutputPath)jni.c" /> |
| 39 | + <ClCompileInclude="*.cc" /> |
| 40 | + </ItemGroup> |
| 41 | + |
| 42 | + <TargetName="_BuildJni_c" |
| 43 | +Inputs="$(_JNIEnvGenPath)" |
| 44 | +Outputs="$(IntermediateOutputPath)jni.c"> |
| 45 | + <MakeDirDirectories="$(OutputPath)" /> |
| 46 | + <ExecCommand="$(_RunJNIEnvGen) $(IntermediateOutputPath)jni.g.cs $(IntermediateOutputPath)jni.c" /> |
| 47 | + </Target> |
| 48 | + |
| 49 | + <TargetName="_GetCmakeOptions"> |
| 50 | + <PropertyGroupCondition=" '$(TargetFramework)' == 'net472' And '@(MonoIncludePath->Count())' != '0' "> |
| 51 | + <_MonoDirs>"-DMONO_INCLUDE_LIST=@(MonoIncludePath, ';')"</_MonoDirs> |
| 52 | + <_MonoLib>"-DMONO_LINK_FLAGS=$(MonoLibs)"</_MonoLib> |
| 53 | + <_EnableMono>-DENABLE_MONO_INTEGRATION=ON</_EnableMono> |
| 54 | + </PropertyGroup> |
| 55 | + <PropertyGroup> |
| 56 | + <_JdkDirs>"-DJDK_INCLUDE_LIST=@(JdkIncludePath, ';')"</_JdkDirs> |
| 57 | + <_Jni_c>"-DJNI_C_PATH=$(MSBuildThisFileDirectory)$(IntermediateOutputPath)jni.c"</_Jni_c> |
| 58 | + <_ExtraArgs>$([MSBuild]::Escape('$(_JdkDirs) $(_Jni_c) $(_EnableMono) $(_MonoDirs) $(_MonoLib)'))</_ExtraArgs> |
| 59 | + </PropertyGroup> |
| 60 | + </Target> |
| 61 | + |
| 62 | + <TargetName="_BuildLibs" |
| 63 | +DependsOnTargets="GetNativeBuildCommands;_BuildJni_c;_GetCmakeOptions" |
| 64 | +BeforeTargets="Build" |
| 65 | +Inputs="@(_JavaInteropNativeLib);$(MSBuildThisFileFullPath);java-interop.csproj;@(ClInclude);@(ClCompile)" |
| 66 | +Outputs="$(OutputPath)%(_JavaInteropNativeLib.Dir)$(_JavaInteropLibName)"> |
| 67 | + <MakeDirDirectories="$(IntermediateOutputPath)%(_JavaInteropNativeLib.Dir)" /> |
| 68 | + <ItemGroup> |
| 69 | + <_Cmake |
| 70 | +Condition=" '$(PrepareNativeToolchain)' != '' " |
| 71 | +Include="PrepareNativeToolchain=$(PrepareNativeToolchain) %(_JavaInteropNativeLib.Arch)" |
| 72 | + /> |
| 73 | + <_CmakeInclude="CmakePath=$(CmakePath)" /> |
| 74 | + <_CmakeInclude="CmakeGenerator=$(CmakeGenerator)" /> |
| 75 | + <_CmakeInclude="CmakeSourceDir=$(MSBuildThisFileDirectory)" /> |
| 76 | + <_CmakeInclude="CmakeBuildDir=$(MSBuildThisFileDirectory)$(IntermediateOutputPath)%(_JavaInteropNativeLib.Dir)" /> |
| 77 | + <_CmakeInclude="CmakeExtraArgs=$(_ExtraArgs)" /> |
| 78 | + </ItemGroup> |
| 79 | + <MSBuild |
| 80 | +Projects="..\..\build-tools\scripts\RunCmake.proj" |
| 81 | +Properties="@(_Cmake)" |
| 82 | +Targets="Cmake" |
| 83 | + /> |
| 84 | + <MakeDirDirectories="$(OutputPath)%(_JavaInteropNativeLib.Dir)" /> |
| 85 | + <ItemGroup> |
| 86 | + <_LibsInclude="$(IntermediateOutputPath)%(_JavaInteropNativeLib.Dir)$(_JavaInteropLibName)*" /> |
| 87 | + </ItemGroup> |
| 88 | + <Copy |
| 89 | +SourceFiles="@(_Libs)" |
| 90 | +DestinationFolder="$(OutputPath)%(_JavaInteropNativeLib.Dir)" |
| 91 | + /> |
| 92 | + <TouchFiles="$(OutputPath)%(_JavaInteropNativeLib.Dir)$(_JavaInteropLibName)" /> |
| 93 | + </Target> |
| 94 | + |
| 95 | + <TargetName="_Clean" |
| 96 | +AfterTargets="Clean"> |
| 97 | + <DeleteFiles="@(None)" /> |
| 98 | + </Target> |
| 99 | + |
| 100 | +</Project> |
0 commit comments