|
7 | 7 | <_JavaInteropLibName Condition=" '$(OS)' != 'Windows_NT' And !Exists ('/Library/Frameworks/') ">libjava-interop.so</_JavaInteropLibName> |
8 | 8 | <_JavaInteropLibName Condition=" '$(OS)' == 'Windows_NT' ">java-interop.dll</_JavaInteropLibName> |
9 | 9 | </PropertyGroup> |
10 | | - <PropertyGroup Condition=" '$(OS)' != 'Windows_NT' "> |
11 | | - <_PrimaryOutputPath>$(OutputPath)$(_JavaInteropLibName)</_PrimaryOutputPath> |
12 | | - </PropertyGroup> |
13 | | - <PropertyGroup Condition=" '$(OS)' == 'Windows_NT' "> |
14 | | - <_PrimaryDir>win-x64</_PrimaryDir> |
15 | | - <_PrimaryArch>x86_amd64</_PrimaryArch> |
16 | | - <_PrimaryOutputPath>$(OutputPath)$(_PrimaryDir)\$(_JavaInteropLibName)</_PrimaryOutputPath> |
17 | | - <_SecondaryDir>win-x86</_SecondaryDir> |
18 | | - <_SecondaryArch>x86</_SecondaryArch> |
19 | | - <_SecondaryOutputPath>$(OutputPath)$(_SecondaryDir)\$(_JavaInteropLibName)</_SecondaryOutputPath> |
20 | | - </PropertyGroup> |
21 | 10 |
|
22 | | - <ItemGroup Condition=" '$(OS)' == 'Windows_NT' "> |
23 | | - <None Include="$(_PrimaryOutputPath)"> |
24 | | - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
25 | | - <Link>$(_PrimaryDir)\$(_JavaInteropLibName)</Link> |
26 | | - </None> |
27 | | - <None Include="$(_SecondaryOutputPath)"> |
28 | | - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
29 | | - <Link>$(_SecondaryDir)\$(_JavaInteropLibName)</Link> |
30 | | - </None> |
| 11 | + <ItemGroup> |
| 12 | + <ClInclude Include="*.h" /> |
| 13 | + </ItemGroup> |
| 14 | + |
| 15 | + <ItemGroup> |
| 16 | + <ClCompile Include="$(IntermediateOutputPath)jni.c" /> |
| 17 | + <ClCompile Include="*.cc" /> |
31 | 18 | </ItemGroup> |
32 | 19 |
|
| 20 | + <ItemGroup Condition=" '$(OS)' == 'Windows_NT' "> |
| 21 | + <_JavaInteropNativeLib Include="CMakeLists.txt"> |
| 22 | + <Arch>x86_amd64</Arch> |
| 23 | + <Dir>win-x64\</Dir> |
| 24 | + </_JavaInteropNativeLib> |
| 25 | + <_JavaInteropNativeLib Include="CMakeLists.txt"> |
| 26 | + <Arch>x86</Arch> |
| 27 | + <Dir>win-x86\</Dir> |
| 28 | + </_JavaInteropNativeLib> |
| 29 | + </ItemGroup> |
33 | 30 | <ItemGroup Condition=" '$(OS)' != 'Windows_NT' "> |
34 | | - <None Include="$(_PrimaryOutputPath)"> |
| 31 | + <_JavaInteropNativeLib Include="CMakeLists.txt" /> |
| 32 | + </ItemGroup> |
| 33 | + |
| 34 | + <ItemGroup> |
| 35 | + <None Include="@(_JavaInteropNativeLib->'$(OutputPath)%(Dir)$(_JavaInteropLibName)')"> |
35 | 36 | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
| 37 | + <Link>%(Dir)$(_JavaInteropLibName)</Link> |
36 | 38 | </None> |
37 | 39 | </ItemGroup> |
38 | 40 |
|
|
43 | 45 | <Exec Command="$(_RunJNIEnvGen) $(IntermediateOutputPath)jni.g.cs $(IntermediateOutputPath)jni.c" /> |
44 | 46 | </Target> |
45 | 47 |
|
46 | | - <Target Name="_BuildLibs" |
47 | | - BeforeTargets="Build" |
48 | | - DependsOnTargets="_BuildPrimaryLib;_BuildSecondaryLib"> |
49 | | - </Target> |
50 | | - |
51 | 48 | <Target Name="_GetCmakeOptions"> |
52 | 49 | <PropertyGroup Condition=" '$(TargetFramework)' == 'net472' And '@(MonoIncludePath->Count())' != '0' "> |
53 | 50 | <_MonoDirs>"-DMONO_INCLUDE_LIST=@(MonoIncludePath, ';')"</_MonoDirs> |
|
61 | 58 | </PropertyGroup> |
62 | 59 | </Target> |
63 | 60 |
|
64 | | - <Target Name="_BuildPrimaryLib" |
65 | | - DependsOnTargets="GetNativeBuildCommands;_BuildJni_c;_GetCmakeOptions" |
66 | | - Inputs="CMakeLists.txt;$(MSBuildThisFileFullPath);java-interop.csproj" |
67 | | - Outputs="$(_PrimaryOutputPath)"> |
68 | | - <MakeDir Directories="$(IntermediateOutputPath)$(_PrimaryDir)" /> |
69 | | - <ItemGroup> |
70 | | - <_Cmake |
71 | | - Condition=" '$(PrepareNativeToolchain)' != '' " |
72 | | - Include="PrepareNativeToolchain=$(PrepareNativeToolchain) $(_PrimaryArch)" |
73 | | - /> |
74 | | - <_Cmake Include="CmakePath=$(CmakePath)" /> |
75 | | - <_Cmake Include="CmakeGenerator=$(CmakeGenerator)" /> |
76 | | - <_Cmake Include="CmakeSourceDir=$(MSBuildThisFileDirectory)" /> |
77 | | - <_Cmake Include="CmakeBuildDir=$(MSBuildThisFileDirectory)$(IntermediateOutputPath)$(_PrimaryDir)" /> |
78 | | - <_Cmake Include="CmakeExtraArgs=$(_ExtraArgs)" /> |
79 | | - </ItemGroup> |
80 | | - <MSBuild |
81 | | - Projects="..\..\build-tools\scripts\RunCmake.proj" |
82 | | - Properties="@(_Cmake)" |
83 | | - Targets="Cmake" |
84 | | - /> |
85 | | - <MakeDir Directories="$(OutputPath)$(_PrimaryDir)" /> |
86 | | - <ItemGroup> |
87 | | - <_Libs Include="$(IntermediateOutputPath)$(_PrimaryDir)\$(_JavaInteropLibName)*" /> |
88 | | - </ItemGroup> |
89 | | - <Copy |
90 | | - SourceFiles="@(_Libs)" |
91 | | - DestinationFolder="$(OutputPath)$(_PrimaryDir)" |
92 | | - /> |
93 | | - <Touch Files="$(_PrimaryOutputPath)" /> |
94 | | - </Target> |
95 | | - |
96 | | - <Target Name="_BuildSecondaryLib" |
97 | | - Condition=" '$(_SecondaryOutputPath)' != '' " |
| 61 | + <Target Name="_BuildLibs" |
98 | 62 | DependsOnTargets="GetNativeBuildCommands;_BuildJni_c;_GetCmakeOptions" |
99 | | - Inputs="CMakeLists.txt;$(MSBuildThisFileFullPath);java-interop.csproj" |
100 | | - Outputs="$(_SecondaryOutputPath)"> |
101 | | - <MakeDir Directories="$(IntermediateOutputPath)$(_SecondaryDir)" /> |
| 63 | + BeforeTargets="Build" |
| 64 | + Inputs="@(_JavaInteropNativeLib);$(MSBuildThisFileFullPath);java-interop.csproj;@(ClInclude);$(ClCompile)" |
| 65 | + Outputs="$(OutputPath)%(_JavaInteropNativeLib.Dir)$(_JavaInteropLibName)"> |
| 66 | + <Message Text="# jonp: _Test: Building: @(_JavaInteropNativeLib->'%(Identity) for %(Arch)', ' ')" /> |
| 67 | + <MakeDir Directories="$(IntermediateOutputPath)%(_JavaInteropNativeLib.Dir)" /> |
102 | 68 | <ItemGroup> |
103 | 69 | <_Cmake |
104 | 70 | Condition=" '$(PrepareNativeToolchain)' != '' " |
105 | | - Include="PrepareNativeToolchain=$(PrepareNativeToolchain) $(_SecondaryArch)" |
| 71 | + Include="PrepareNativeToolchain=$(PrepareNativeToolchain) %(_JavaInteropNativeLib.Arch)" |
106 | 72 | /> |
107 | 73 | <_Cmake Include="CmakePath=$(CmakePath)" /> |
108 | 74 | <_Cmake Include="CmakeGenerator=$(CmakeGenerator)" /> |
109 | 75 | <_Cmake Include="CmakeSourceDir=$(MSBuildThisFileDirectory)" /> |
110 | | - <_Cmake Include="CmakeBuildDir=$(MSBuildThisFileDirectory)$(IntermediateOutputPath)$(_SecondaryDir)" /> |
| 76 | + <_Cmake Include="CmakeBuildDir=$(MSBuildThisFileDirectory)$(IntermediateOutputPath)%(_JavaInteropNativeLib.Dir)" /> |
111 | 77 | <_Cmake Include="CmakeExtraArgs=$(_ExtraArgs)" /> |
112 | 78 | </ItemGroup> |
113 | 79 | <MSBuild |
114 | 80 | Projects="..\..\build-tools\scripts\RunCmake.proj" |
115 | 81 | Properties="@(_Cmake)" |
116 | 82 | Targets="Cmake" |
117 | 83 | /> |
118 | | - <MakeDir Directories="$(OutputPath)$(_SecondaryDir)" /> |
| 84 | + <MakeDir Directories="$(OutputPath)%(_JavaInteropNativeLib.Dir)" /> |
119 | 85 | <ItemGroup> |
120 | | - <_Libs Include="$(IntermediateOutputPath)$(_SecondaryDir)\$(_JavaInteropLibName)*" /> |
| 86 | + <_Libs Include="$(IntermediateOutputPath)%(_JavaInteropNativeLib.Dir)$(_JavaInteropLibName)*" /> |
121 | 87 | </ItemGroup> |
122 | 88 | <Copy |
123 | 89 | SourceFiles="@(_Libs)" |
124 | | - DestinationFolder="$(OutputPath)$(_SecondaryDir)" |
| 90 | + DestinationFolder="$(OutputPath)%(_JavaInteropNativeLib.Dir)" |
125 | 91 | /> |
126 | | - <Touch Files="$(_SecondaryOutputPath)" /> |
| 92 | + <Touch Files="$(OutputPath)%(_JavaInteropNativeLib.Dir)$(_JavaInteropLibName)" /> |
127 | 93 | </Target> |
128 | 94 |
|
129 | 95 | <Target Name="_Clean" |
|
0 commit comments