forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmono.proj
584 lines (507 loc) · 36.8 KB
/
mono.proj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
<Project>
<Import Project="Directory.Build.props" />
<Import Project="Directory.Build.targets" />
<PropertyGroup>
<MonoObjDir>$(ArtifactsObjDir)mono/$(PlatformConfigPathPart)/</MonoObjDir>
<MonoEnableLLVM Condition="'$(MonoEnableLLVM)' == ''">false</MonoEnableLLVM>
<MonoEnableCXX Condition="'$(MonoEnableCXX)' == ''">false</MonoEnableCXX>
<MonoLLVMDir Condition="'$(MonoEnableLLVM)' == 'true' and '$(MonoLLVMDir)' == ''">$(MonoObjDir)llvm</MonoLLVMDir>
<MonoCrossDir Condition="'$(MonoCrossDir)' == '' and '$(ROOTFS_DIR)' != ''">$(ROOTFS_DIR)</MonoCrossDir>
<DotNetExec Condition="'$(OS)' == 'Windows_NT'">dotnet.exe</DotNetExec>
<DotNetExec Condition="'$(DotNetExec)' == ''">dotnet</DotNetExec>
<LocalDotnetDir>$(RepoRoot).dotnet</LocalDotnetDir>
<LocalDotnet>$(LocalDotnetDir)\$(DotNetExec)</LocalDotnet>
<LocalMonoDotnetDir>$(RepoRoot).dotnet-mono</LocalMonoDotnetDir>
<LocalMonoDotnet>$(LocalMonoDotnetDir)\$(DotNetExec)</LocalMonoDotnet>
<ScriptExt Condition="'$(OS)' == 'Windows_NT'">.cmd</ScriptExt>
<ScriptExt Condition="'$(OS)' != 'Windows_NT'">.sh</ScriptExt>
<CoreClrFileName Condition="'$(TargetsWindows)' == 'true'">coreclr.dll</CoreClrFileName>
<CoreClrFileName Condition="'$(TargetsOSX)' == 'true'">libcoreclr.dylib</CoreClrFileName>
<CoreClrFileName Condition="'$(CoreClrFileName)' == ''">libcoreclr.so</CoreClrFileName>
<MonoFileName Condition="'$(TargetsiOS)' == 'true'">libmono.dylib</MonoFileName>
<MonoStaticFileName Condition="'$(TargetsiOS)' == 'true'">libmono.a</MonoStaticFileName>
<MonoFileName Condition="'$(MonoFileName)' == ''">$(CoreClrFileName)</MonoFileName>
<CoreClrTestConfig Condition="'$(CoreClrTestConfig)' == ''">$(Configuration)</CoreClrTestConfig>
<LibrariesTestConfig Condition="'$(LibrariesTestConfig)' == ''">$(Configuration)</LibrariesTestConfig>
<CoreClrTestCoreRoot>$(ArtifactsDir)tests\coreclr\$(TargetOS).$(Platform).$(CoreClrTestConfig)\Tests\Core_Root</CoreClrTestCoreRoot>
<LibrariesTesthostRoot>$(ArtifactsDir)bin\testhost\$(NetCoreAppCurrent)-$(TargetOS)-$(LibrariesTestConfig)-$(Platform)\</LibrariesTesthostRoot>
<LibrariesTesthostRuntimeDir>$(LibrariesTesthostRoot)shared\Microsoft.NETCore.App\$(ProductVersion)\</LibrariesTesthostRuntimeDir>
<XcodeDir Condition="'$(XcodeDir)' == ''">/Applications/Xcode.app/Contents/Developer</XcodeDir>
</PropertyGroup>
<!-- OSX/iOS/Linux Mono runtime build -->
<Target Name="ConfigureMonoRuntimeUnix" Condition="'$(OS)' != 'Windows_NT'" Inputs="$(MonoProjectRoot)configure.ac" Outputs="$(MonoObjDir)config.h">
<!-- Sanity checks -->
<Error Condition="'$(TargetOS)' == 'iOS' and '$(Platform)' != 'x64' and '$(Platform)' != 'arm64' and '$(Platform)' != 'arm'" Text="Error: Invalid platform for $(TargetOS): $(Platform)." />
<Error Condition="'$(TargetOS)' == 'iOS' and !$([MSBuild]::IsOSPlatform('OSX'))" Text="Error: $(TargetOS) can only be built on macOS." />
<!-- Common options -->
<ItemGroup>
<_MonoConfigureParams Include="--with-core=only" />
<_MonoConfigureParams Include="--enable-maintainer-mode" />
<_MonoConfigureParams Include="--enable-compile-warnings" />
<_MonoConfigureParams Include="--prefix=$(MonoObjDir)out" />
<_MonoConfigureParams Condition="'$(MonoEnableLLVM)' == 'true'" Include="--with-llvm=$(MonoLLVMDir)" /> <!-- TODO: integrate for iOS -->
<_MonoConfigureParams Condition="'$(MonoEnableCXX)' == 'true'" Include="--enable-cxx" />
</ItemGroup>
<!-- Debug specific options -->
<ItemGroup Condition="'$(Configuration)' == 'Debug'">
<_MonoConfigureParams Include="--enable-checked-build=private_types" />
<_MonoCFLAGS Include="-O0" />
<_MonoCFLAGS Include="-ggdb3" />
<_MonoCFLAGS Include="-fno-omit-frame-pointer" />
<_MonoCXXFLAGS Include="-O0" />
<_MonoCXXFLAGS Include="-ggdb3" />
<_MonoCXXFLAGS Include="-fno-omit-frame-pointer" />
<_MonoCXXFLAGS Include="-D_GLIBCXX_USE_CXX11_ABI=0" />
</ItemGroup>
<!-- Release specific options -->
<ItemGroup Condition="'$(Configuration)' == 'Release'">
<_MonoCFLAGS Include="-O2" />
<_MonoCFLAGS Include="-g" />
<_MonoCXXFLAGS Include="-O2" />
<_MonoCXXFLAGS Include="-g" />
<_MonoCXXFLAGS Include="-D_GLIBCXX_USE_CXX11_ABI=0" />
</ItemGroup>
<!-- iOS device specific options -->
<ItemGroup Condition="'$(TargetOS)' == 'iOS' and '$(TargetsiOSSimulator)' != 'true'">
<_MonoConfigureParams Condition="'$(Platform)' == 'arm64'" Include="--host=aarch64-apple-darwin10" />
<_MonoConfigureParams Condition="'$(Platform)' == 'arm'" Include="--host=arm-apple-darwin10" />
<_MonoConfigureParams Include="--disable-boehm" />
<_MonoConfigureParams Include="--disable-btls" />
<_MonoConfigureParams Include="--disable-executables" />
<_MonoConfigureParams Include="--disable-icall-tables" />
<_MonoConfigureParams Include="--disable-iconv" />
<_MonoConfigureParams Include="--disable-mcs-build" />
<_MonoConfigureParams Include="--disable-nls" />
<_MonoConfigureParams Include="--disable-visibility-hidden" />
<_MonoConfigureParams Include="--enable-dtrace=no" />
<_MonoConfigureParams Include="--enable-icall-export" />
<_MonoConfigureParams Include="--enable-maintainer-mode" />
<_MonoConfigureParams Include="--enable-minimal=ssa,com,interpreter,jit,portability,assembly_remapping,attach,verifier,full_messages,appdomains,security,sgen_remset,sgen_marksweep_par,sgen_marksweep_fixed,sgen_marksweep_fixed_par,sgen_copying,logging,remoting,shared_perfcounters,gac" />
<_MonoConfigureParams Include="--enable-monotouch" />
<_MonoConfigureParams Include="--with-lazy-gc-thread-creation=yes" />
<_MonoConfigureParams Include="--with-tls=pthread" />
<_MonoConfigureParams Include="--without-ikvm-native" />
<_MonoConfigureParams Include="--without-sigaltstack" />
<_MonoConfigureParams Include="--disable-cooperative-suspend" />
<_MonoConfigureParams Include="--disable-hybrid-suspend" />
<_MonoConfigureParams Include="--disable-crash-reporting" />
<_MonoAC_VARS Include="ac_cv_c_bigendian=no" />
<_MonoAC_VARS Include="ac_cv_func_fstatat=no" />
<_MonoAC_VARS Include="ac_cv_func_readlinkat=no" />
<_MonoAC_VARS Include="ac_cv_func_getpwuid_r=no" />
<_MonoAC_VARS Include="ac_cv_func_posix_getpwuid_r=yes" />
<_MonoAC_VARS Include="ac_cv_header_curses_h=no" />
<_MonoAC_VARS Include="ac_cv_header_localcharset_h=no" />
<_MonoAC_VARS Include="ac_cv_header_sys_user_h=no" />
<_MonoAC_VARS Include="ac_cv_func_getentropy=no" />
<_MonoAC_VARS Include="ac_cv_func_futimens=no" />
<_MonoAC_VARS Include="ac_cv_func_utimensat=no" />
<_MonoAC_VARS Include="ac_cv_func_shm_open_working_with_mmap=no" />
<_MonoAC_VARS Include="mono_cv_sizeof_sunpath=104" />
<_MonoAC_VARS Include="mono_cv_uscore=yes" />
<_MonoCFLAGS Condition="'$(Platform)' == 'arm64'" Include="-arch arm64" />
<_MonoCFLAGS Condition="'$(Platform)' == 'arm'" Include="-arch armv7" />
<_MonoCFLAGS Condition="'$(Platform)' == 'arm'" Include="-arch armv7s" />
<_MonoCFLAGS Include="-isysroot $(XcodeDir)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$(iOSVersion).sdk" />
<_MonoCFLAGS Include="-miphoneos-version-min=$(iOSVersionMin)" />
<_MonoCFLAGS Include="-Wl,-application_extension" />
<_MonoCFLAGS Include="-fexceptions" />
<_MonoCXXFLAGS Condition="'$(Platform)' == 'arm64'" Include="-arch arm64" />
<_MonoCXXFLAGS Condition="'$(Platform)' == 'arm'" Include="-arch armv7" />
<_MonoCXXFLAGS Condition="'$(Platform)' == 'arm'" Include="-arch armv7s" />
<_MonoCXXFLAGS Include="-isysroot $(XcodeDir)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$(iOSVersion).sdk" />
<_MonoCXXFLAGS Include="-miphoneos-version-min=$(iOSVersionMin)" />
<_MonoCXXFLAGS Include="-Wl,-application_extension" />
<_MonoCPPFLAGS Condition="'$(Platform)' == 'arm64'" Include="-arch arm64" />
<_MonoCPPFLAGS Condition="'$(Platform)' == 'arm'" Include="-arch armv7" />
<!-- Intentionally disabled since multiple -arch cause issues during configure.ac C-preprocessor detection. Shouldn't have an effect on the actual build. -->
<!--<_MonoCPPFLAGS Condition="'$(Platform)' == 'arm'" Include="-arch armv7s" />-->
<_MonoCPPFLAGS Include="-isysroot $(XcodeDir)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$(iOSVersion).sdk" />
<_MonoCPPFLAGS Include="-miphoneos-version-min=$(iOSVersionMin)" />
<_MonoCPPFLAGS Include="-DMONOTOUCH=1" />
<_MonoCPPFLAGS Include="-DSMALL_CONFIG" />
<_MonoCPPFLAGS Include="-D_XOPEN_SOURCE" />
<_MonoCPPFLAGS Include="-DHOST_IOS" />
<_MonoCPPFLAGS Include="-DHAVE_LARGE_FILE_SUPPORT=1" />
<_MonoLDFLAGS Condition="'$(Platform)' == 'arm64'" Include="-arch arm64" />
<_MonoLDFLAGS Condition="'$(Platform)' == 'arm'" Include="-arch armv7" />
<_MonoLDFLAGS Condition="'$(Platform)' == 'arm'" Include="-arch armv7s" />
<_MonoLDFLAGS Include="-Wl,-no_weak_imports" />
<_MonoLDFLAGS Include="-framework CoreFoundation" />
<_MonoLDFLAGS Include="-lobjc" />
<_MonoLDFLAGS Include="-lc++" />
<!-- AOT cross-compiler configuration -->
<_MonoAotCrossConfigureParams Include="--host=x86_64-apple-darwin10" />
<_MonoAotCrossConfigureParams Condition="'$(Platform)' == 'arm64'" Include="--target=aarch64-darwin" />
<_MonoAotCrossConfigureParams Condition="'$(Platform)' == 'arm'" Include="--target=arm-darwin" />
<_MonoAotCrossConfigureParams Include="--with-cross-offsets=$(MonoObjDir)cross/offsets-$(Platform)-darwin.h" />
<_MonoAotCrossConfigureParams Include="--with-core=only" /> <!-- TODO: remove duplication with main configure params -->
<_MonoAotCrossConfigureParams Include="--enable-maintainer-mode" />
<_MonoAotCrossConfigureParams Include="--enable-compile-warnings" />
<_MonoAotCrossConfigureParams Include="--prefix=$(MonoObjDir)cross/out" />
<_MonoAotCrossConfigureParams Include="--disable-boehm" />
<_MonoAotCrossConfigureParams Include="--disable-btls" />
<_MonoAotCrossConfigureParams Include="--disable-iconv" />
<_MonoAotCrossConfigureParams Include="--disable-libraries" />
<_MonoAotCrossConfigureParams Include="--disable-mcs-build" />
<_MonoAotCrossConfigureParams Include="--disable-nls" />
<_MonoAotCrossConfigureParams Include="--enable-dtrace=no" />
<_MonoAotCrossConfigureParams Include="--enable-icall-symbol-map" />
<_MonoAotCrossConfigureParams Include="--enable-minimal=com,remoting" />
<_MonoAotCrossConfigureParams Include="--enable-monotouch" />
<_MonoAotCrossConfigureParams Include="--disable-crash-reporting" />
<!--<_MonoAotCrossConfigureParams Include="with-llvm=/Users/alexander/dev/mono2/sdks/out/llvm-llvm64" /> --> <!-- TODO -->
<_MonoAotCrossAC_VARS Include="ac_cv_func_shm_open_working_with_mmap=no" />
<_MonoAotCrossCFLAGS Include="-O2" />
<_MonoAotCrossCFLAGS Include="-g" />
<_MonoAotCrossCFLAGS Include="-isysroot $(XcodeDir)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(macOSVersion).sdk" />
<_MonoAotCrossCFLAGS Include="-mmacosx-version-min=$(macOSVersionMin)" />
<_MonoAotCrossCFLAGS Include="-Qunused-arguments" />
<_MonoAotCrossCFLAGS Include="-m64" />
<_MonoAotCrossCXXFLAGS Include="-O2" />
<_MonoAotCrossCXXFLAGS Include="-g" />
<_MonoAotCrossCXXFLAGS Include="-isysroot $(XcodeDir)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(macOSVersion).sdk" />
<_MonoAotCrossCXXFLAGS Include="-mmacosx-version-min=$(macOSVersionMin)" />
<_MonoAotCrossCXXFLAGS Include="-Qunused-arguments" />
<_MonoAotCrossCXXFLAGS Include="-stdlib=libc++" />
<_MonoAotCrossCXXFLAGS Include="-m64" />
<_MonoAotCrossCPPFLAGS Include="-O2" />
<_MonoAotCrossCPPFLAGS Include="-g" />
<_MonoAotCrossCPPFLAGS Include="-DMONOTOUCH=1" />
<_MonoAotCrossCPPFLAGS Include="-m64" />
<_MonoAotCrossCXXPPFLAGS Include="-O2" />
<_MonoAotCrossCXXPPFLAGS Include="-g" />
<_MonoAotCrossCXXPPFLAGS Include="-m64" />
<_MonoAotCrossLDFLAGS Include="-stdlib=libc++" />
<_MonoAotCrossOffsetsToolParams Condition="'$(Platform)' == 'arm64'" Include="--abi=aarch64-apple-darwin10" />
<_MonoAotCrossOffsetsToolParams Condition="'$(Platform)' == 'arm'" Include="--abi=arm-apple-darwin10" />
<_MonoAotCrossOffsetsToolParams Include="--netcore" />
<_MonoAotCrossOffsetsToolParams Include="--targetdir="$(MonoObjDir)"" />
<_MonoAotCrossOffsetsToolParams Include="--monodir="$(MonoProjectRoot)"" />
<_MonoAotCrossOffsetsToolParams Include="--outfile="$(MonoObjDir)cross/offsets-$(Platform)-darwin.h"" />
<_MonoAotCrossOffsetsToolParams Include="--libclang="$(XcodeDir)/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib"" />
<_MonoAotCrossOffsetsToolParams Include="--sysroot="$(XcodeDir)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$(iOSVersion).sdk"" />
</ItemGroup>
<!-- iOS simulator specific options -->
<ItemGroup Condition="'$(TargetOS)' == 'iOS' and '$(TargetsiOSSimulator)' == 'true'">
<_MonoConfigureParams Include="--host=x86_64-apple-darwin10" />
<_MonoConfigureParams Include="--disable-boehm" />
<_MonoConfigureParams Include="--disable-btls" />
<_MonoConfigureParams Include="--disable-executables" />
<_MonoConfigureParams Include="--disable-iconv" />
<_MonoConfigureParams Include="--disable-mcs-build" />
<_MonoConfigureParams Include="--disable-nls" />
<_MonoConfigureParams Include="--disable-visibility-hidden" />
<_MonoConfigureParams Include="--enable-maintainer-mode" />
<_MonoConfigureParams Include="--enable-minimal=com,remoting,shared_perfcounters,gac" />
<_MonoConfigureParams Include="--enable-monotouch" />
<_MonoConfigureParams Include="--with-tls=pthread" />
<_MonoConfigureParams Include="--without-ikvm-native" />
<_MonoConfigureParams Include="--disable-cooperative-suspend" />
<_MonoConfigureParams Include="--disable-hybrid-suspend" />
<_MonoConfigureParams Include="--disable-crash-reporting" />
<_MonoAC_VARS Include="ac_cv_func_clock_nanosleep=no" />
<_MonoAC_VARS Include="ac_cv_func_fstatat=no" />
<_MonoAC_VARS Include="ac_cv_func_readlinkat=no" />
<_MonoAC_VARS Include="ac_cv_func_system=no" />
<_MonoAC_VARS Include="ac_cv_func_getentropy=no" />
<_MonoAC_VARS Include="ac_cv_func_futimens=no" />
<_MonoAC_VARS Include="ac_cv_func_utimensat=no" />
<_MonoAC_VARS Include="ac_cv_func_shm_open_working_with_mmap=no" />
<_MonoAC_VARS Include="mono_cv_uscore=yes" />
<_MonoCFLAGS Include="-arch x86_64" />
<_MonoCFLAGS Include="-m64" />
<_MonoCFLAGS Include="-isysroot $(XcodeDir)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator$(iOSVersion).sdk" />
<_MonoCFLAGS Include="-mios-simulator-version-min=$(iOSVersionMin)" />
<_MonoCFLAGS Include="-Wl,-application_extension" />
<_MonoCXXFLAGS Include="-arch x86_64" />
<_MonoCXXFLAGS Include="-m64" />
<_MonoCXXFLAGS Include="-isysroot $(XcodeDir)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator$(iOSVersion).sdk" />
<_MonoCXXFLAGS Include="-mios-simulator-version-min=$(iOSVersionMin)" />
<_MonoCXXFLAGS Include="-Wl,-application_extension" />
<_MonoCPPFLAGS Include="-arch x86_64" />
<_MonoCPPFLAGS Include="-m64" />
<_MonoCPPFLAGS Include="-isysroot $(XcodeDir)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator$(iOSVersion).sdk" />
<_MonoCPPFLAGS Include="-mios-simulator-version-min=$(iOSVersionMin)" />
<_MonoCPPFLAGS Include="-Wl,-application_extension" />
<_MonoCPPFLAGS Include="-DMONOTOUCH=1" />
<_MonoCPPFLAGS Include="-DHOST_IOS" />
</ItemGroup>
<!-- iOS device/simulator specific options -->
<PropertyGroup Condition="'$(TargetOS)' == 'iOS'">
<_MonoCCOption>CC="$(XcodeDir)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"</_MonoCCOption>
<_MonoCXXOption>CXX="$(XcodeDir)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"</_MonoCXXOption>
<_MonoAROption>AR=""</_MonoAROption>
<_MonoASOption>AS=""</_MonoASOption>
<_MonoCPPOption>CPP=""</_MonoCPPOption>
<_MonoCXXCPPOption>CXXCPP=""</_MonoCXXCPPOption>
<_MonoDLLTOOLOption>DLLTOOL=""</_MonoDLLTOOLOption>
<_MonoLDOption>LD=""</_MonoLDOption>
<_MonoOBJDUMPOption>OBJDUMP=""</_MonoOBJDUMPOption>
<_MonoRANLIBOption>RANLIB=""</_MonoRANLIBOption>
<_MonoCMAKEOption>CMAKE=""</_MonoCMAKEOption>
<_MonoSTRIPOption>STRIP=""</_MonoSTRIPOption>
</PropertyGroup>
<!-- ARM Linux cross build options -->
<PropertyGroup Condition="'$(MonoCrossDir)' != '' and ('$(TargetArchitecture)' == 'arm' Or '$(TargetArchitecture)' == 'arm64')">
<_MonoTuple Condition="'$(TargetArchitecture)' == 'arm64'">aarch64-linux-gnu</_MonoTuple>
<_MonoTuple Condition="'$(TargetArchitecture)' == 'arm'">arm-linux-gnueabihf</_MonoTuple>
<_MonoRANLIBOption>RANLIB="$(_MonoTuple)-ranlib"</_MonoRANLIBOption>
<_MonoAROption>AR="$(_MonoTuple)-ar"</_MonoAROption>
<_MonoASOption>AS="$(_MonoTuple)-as"</_MonoASOption>
<_MonoLDOption>LD="$(_MonoTuple)-ld"</_MonoLDOption>
<_MonoSTRIPOption>STRIP="$(_MonoTuple)-strip"</_MonoSTRIPOption>
</PropertyGroup>
<!-- Linux options -->
<ItemGroup Condition="'$(TargetsLinux)' == true">
<_MonoCFLAGS Include="-Wl,--build-id" />
<_MonoCXXFLAGS Include="-Wl,--build-id" />
</ItemGroup>
<ItemGroup Condition="'$(MonoCrossDir)' != '' and ('$(TargetArchitecture)' == 'arm' Or '$(TargetArchitecture)' == 'arm64')">
<_MonoConfigureParams Include="--host=$(_MonoTuple)" />
<_MonoConfigureParams Include="--target=$(_MonoTuple)" />
<_MonoCFLAGS Include="--sysroot=$(MonoCrossDir)" />
<_MonoCFLAGS Include="--target=$(_MonoTuple)" />
<_MonoCXXFLAGS Include="--sysroot=$(MonoCrossDir)" />
<_MonoCXXFLAGS Include="--target=$(_MonoTuple)" />
<_MonoLDFLAGS Include="--sysroot=$(MonoCrossDir)" />
<_MonoLDFLAGS Include="--target=$(_MonoTuple)" />
<_MonoCCLDFLAGS Include="-XCClinker" />
<_MonoCCLDFLAGS Include="--target=$(_MonoTuple)" />
</ItemGroup>
<!-- Common options -->
<PropertyGroup>
<_MonoCFLAGSOption Condition="@(_MonoCFLAGS->Count()) > 0">CFLAGS="@(_MonoCFLAGS, ' ')"</_MonoCFLAGSOption>
<_MonoCXXFLAGSOption Condition="@(_MonoCXXFLAGS->Count()) > 0">CXXFLAGS="@(_MonoCXXFLAGS, ' ')"</_MonoCXXFLAGSOption>
<_MonoCPPFLAGSOption Condition="@(_MonoCPPFLAGS->Count()) > 0">CPPFLAGS="@(_MonoCPPFLAGS, ' ')"</_MonoCPPFLAGSOption>
<_MonoCXXCPPFLAGSOption Condition="@(_MonoCXXCPPFLAGS->Count()) > 0">CXXCPPFLAGS="@(_MonoCXXCPPFLAGS, ' ')"</_MonoCXXCPPFLAGSOption>
<_MonoLDFLAGSOption Condition="@(_MonoLDFLAGS->Count()) > 0">LDFLAGS="@(_MonoLDFLAGS, ' ')"</_MonoLDFLAGSOption>
<_MonoCCLDFLAGSOption Condition="@(_MonoCCLDFLAGS->Count()) > 0">CCLDFLAGS="@(_MonoCCLDFLAGS, ' ')"</_MonoCCLDFLAGSOption>
<_MonoConfigureCommand>@(_MonoConfigureParams, ' ') @(_MonoAC_VARS, ' ') $(_MonoCFLAGSOption) $(_MonoCXXFLAGSOption) $(_MonoCPPFLAGSOption) $(_MonoCXXCPPFLAGSOption) $(_MonoLDFLAGSOption) $(_MonoCCLDFLAGSOption) $(_MonoCCOption) $(_MonoCXXOption) $(_MonoAROption) $(_MonoASOption) $(_MonoCPPOption) $(_MonoCXXCPPOption) $(_MonoDLLTOOLOption) $(_MonoLDOption) $(_MonoOBJDUMPOption) $(_MonoRANLIBOption) $(_MonoCMAKEOption) $(_MonoSTRIPOption)</_MonoConfigureCommand>
<_MonoConfigureCommand Condition="'$(_MonoCCOption)' == '' and '$(_MonoCXXOption)' == ''">bash -c 'source $(RepositoryEngineeringDir)native/init-compiler.sh $(Platform) clang && $(MonoProjectRoot)configure $(_MonoConfigureCommand)'</_MonoConfigureCommand>
<_MonoConfigureCommand Condition="'$(_MonoCCOption)' != '' and '$(_MonoCXXOption)' != ''">$(MonoProjectRoot)configure $(_MonoConfigureCommand)</_MonoConfigureCommand>
</PropertyGroup>
<!-- AOT cross-compiler specific options -->
<PropertyGroup Condition="'$(TargetOS)' == 'iOS' and '$(TargetsiOSSimulator)' != 'true'">
<_MonoAotCrossCFLAGSOption Condition="@(_MonoAotCrossCFLAGS->Count()) > 0">CFLAGS="@(_MonoAotCrossCFLAGS, ' ')"</_MonoAotCrossCFLAGSOption>
<_MonoAotCrossCXXFLAGSOption Condition="@(_MonoAotCrossCXXFLAGS->Count()) > 0">CXXFLAGS="@(_MonoAotCrossCXXFLAGS, ' ')"</_MonoAotCrossCXXFLAGSOption>
<_MonoAotCrossCPPFLAGSOption Condition="@(_MonoAotCrossCPPFLAGS->Count()) > 0">CPPFLAGS="@(_MonoAotCrossCPPFLAGS, ' ')"</_MonoAotCrossCPPFLAGSOption>
<_MonoAotCrossCXXCPPFLAGSOption Condition="@(_MonoAotCrossCXXCPPFLAGS->Count()) > 0">CXXCPPFLAGS="@(_MonoAotCrossCXXCPPFLAGS, ' ')"</_MonoAotCrossCXXCPPFLAGSOption>
<_MonoAotCrossLDFLAGSOption Condition="@(_MonoAotCrossLDFLAGS->Count()) > 0">LDFLAGS="@(_MonoAotCrossLDFLAGS, ' ')"</_MonoAotCrossLDFLAGSOption>
<_MonoAotCrossCCLDFLAGSOption Condition="@(_MonoAotCrossCCLDFLAGS->Count()) > 0">CCLDFLAGS="@(_MonoAotCrossCCLDFLAGS, ' ')"</_MonoAotCrossCCLDFLAGSOption>
<_MonoAotCrossConfigureCommand>$(MonoProjectRoot)configure @(_MonoAotCrossConfigureParams, ' ') @(_MonoAotCrossAC_VARS, ' ') $(_MonoAotCrossCFLAGSOption) $(_MonoAotCrossCXXFLAGSOption) $(_MonoAotCrossCPPFLAGSOption) $(_MonoAotCrossCXXCPPFLAGSOption) $(_MonoAotCrossLDFLAGSOption) $(_MonoAotCrossCCLDFLAGSOption) $(_MonoCCOption) $(_MonoCXXOption) $(_MonoAROption) $(_MonoASOption) $(_MonoCPPOption) $(_MonoCXXCPPOption) $(_MonoDLLTOOLOption) $(_MonoLDOption) $(_MonoOBJDUMPOption) $(_MonoRANLIBOption) $(_MonoCMAKEOption) $(_MonoSTRIPOption)</_MonoAotCrossConfigureCommand>
<_MonoAotCrossOffsetsCommand>python3 $(MonoProjectRoot)mono/tools/offsets-tool/offsets-tool.py @(_MonoAotCrossOffsetsToolParams, ' ')</_MonoAotCrossOffsetsCommand>
</PropertyGroup>
<!-- Configure target runtime -->
<MakeDir Directories="$(MonoObjDir)" />
<Message Text="--- Configuring Mono with '$(_MonoConfigureCommand)' ---" Importance="High" />
<Exec Command="NOCONFIGURE=1 $(MonoProjectRoot)autogen.sh" />
<Exec Command="$(_MonoConfigureCommand)" WorkingDirectory="$(MonoObjDir)" IgnoreStandardErrorWarningFormat="true" />
<Touch Files="$(MonoObjDir)config.h" />
<!-- Configure AOT cross compiler (if available) -->
<MakeDir Condition="'$(_MonoAotCrossConfigureCommand)' != ''" Directories="$(MonoObjDir)/cross" />
<Message Condition="'$(_MonoAotCrossOffsetsCommand)' != ''" Text="--- Generating Mono AOT cross-compiler offsets file with '$(_MonoAotCrossOffsetsCommand)' ---" Importance="High" />
<Exec Condition="'$(_MonoAotCrossOffsetsCommand)' != ''" Command="$(_MonoAotCrossOffsetsCommand)" IgnoreStandardErrorWarningFormat="true" />
<Message Condition="'$(_MonoAotCrossConfigureCommand)' != ''" Text="--- Configuring Mono AOT cross-compiler with '$(_MonoAotCrossConfigureCommand)' ---" Importance="High" />
<Exec Condition="'$(_MonoAotCrossConfigureCommand)' != ''" Command="$(_MonoAotCrossConfigureCommand)" WorkingDirectory="$(MonoObjDir)cross" IgnoreStandardErrorWarningFormat="true" />
<Touch Condition="'$(_MonoAotCrossConfigureCommand)' != ''" Files="$(MonoObjDir)cross/config.h" />
</Target>
<Target Name="BuildMonoRuntimeUnix" Condition="'$(OS)' != 'Windows_NT'" DependsOnTargets="ConfigureMonoRuntimeUnix">
<Message Text="--- Building Mono ---" Importance="High" />
<Exec Command="make -j$([System.Environment]::ProcessorCount)" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(MonoObjDir)" />
<Exec Condition="'$(TargetsiOS)' == 'true'" Command="make install -j$([System.Environment]::ProcessorCount)" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(MonoObjDir)" />
<Message Condition="'$(TargetsiOS)' == 'true' and '$(TargetsiOSSimulator)' != 'true'" Text="--- Building Mono AOT cross-compiler ---" Importance="High" />
<Exec Condition="'$(TargetsiOS)' == 'true' and '$(TargetsiOSSimulator)' != 'true'" Command="make -j$([System.Environment]::ProcessorCount)" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(MonoObjDir)cross" />
<Exec Condition="'$(TargetsiOS)' == 'true' and '$(TargetsiOSSimulator)' != 'true'" Command="make install -j$([System.Environment]::ProcessorCount)" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(MonoObjDir)cross" />
</Target>
<!-- Windows Mono runtime build -->
<Target Name="BuildMonoRuntimeWindows" Condition="'$(OS)' == 'Windows_NT'">
<!-- Sanity checks -->
<Error Condition="'$(TargetOS)' == 'iOS'" Text="Error: Mono runtime for $(TargetOS) can't be built on Windows." />
<ItemGroup>
<_MonoBuildParams Include="/p:MONO_BUILD_DIR_PREFIX=""$(MonoObjDir)""" />
<_MonoBuildParams Include="/p:MONO_ENABLE_NETCORE=true" />
<_MonoBuildParams Include="/p:CL_MPCount=$([System.Environment]::ProcessorCount)" />
<_MonoBuildParams Include="/v:minimal" />
<_MonoBuildParams Condition="$(MonoEnableLLVM) == true" Include="/p:MONO_ENABLE_LLVM=true" />
<_MonoBuildParams Condition="$(MonoEnableLLVM) == true" Include="/p:MONO_EXTERNAL_LLVM_CONFIG=""$(MonoLLVMDir)\bin\llvm-config.exe""" />
</ItemGroup>
<PropertyGroup>
<_MonoBuildPlatform Condition="'$(Platform)' == 'x64'">x64</_MonoBuildPlatform>
<_MonoBuildPlatform Condition="'$(Platform)' == 'x86'">win32</_MonoBuildPlatform>
<_MonoBuildCommand>msvc\run-msbuild.bat build $(_MonoBuildPlatform) $(Configuration) sgen "@(_MonoBuildParams, ' ')" msvc\mono-netcore.sln</_MonoBuildCommand>
</PropertyGroup>
<Message Text="--- Building Mono ---" Importance="High" />
<Exec Command="$(_MonoBuildCommand)" IgnoreStandardErrorWarningFormat="true" />
</Target>
<Target Name="BuildCoreLib">
<MSBuild Projects="$(MonoProjectRoot)netcore\System.Private.CoreLib\System.Private.CoreLib.csproj"
Properties="Configuration=$(Configuration)"
Targets="Build" />
</Target>
<!-- General targets -->
<Target Name="Build" DependsOnTargets="BuildMonoRuntimeUnix;BuildMonoRuntimeWindows">
<PropertyGroup>
<_MonoRuntimeFilePath Condition="'$(TargetsWindows)' == 'true' and '$(Platform)' == 'x64'">$(MonoObjDir)x64\Bin\$(Configuration)\mono-2.0-sgen.dll</_MonoRuntimeFilePath>
<_MonoRuntimeFilePath Condition="'$(TargetsWindows)' == 'true' and '$(Platform)' == 'x86'">$(MonoObjDir)Win32\Bin\$(Configuration)\mono-2.0-sgen.dll</_MonoRuntimeFilePath>
<_MonoRuntimeFilePath Condition="'$(TargetsOSX)' == 'true'">$(MonoObjDir)mono\mini\.libs\libmonosgen-2.0.dylib</_MonoRuntimeFilePath>
<_MonoRuntimeFilePath Condition="'$(TargetsiOS)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.dylib</_MonoRuntimeFilePath>
<_MonoRuntimeFilePath Condition="'$(_MonoRuntimeFilePath)' == ''">$(MonoObjDir)mono\mini\.libs\libmonosgen-2.0.so</_MonoRuntimeFilePath>
<_MonoRuntimeStaticFilePath Condition="'$(TargetsiOS)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.a</_MonoRuntimeStaticFilePath>
<_MonoAotCrossFilePath Condition="'$(TargetsiOS)' == 'true' and '$(Platform)' == 'arm64'">$(MonoObjDir)cross\out\bin\aarch64-darwin-mono-sgen</_MonoAotCrossFilePath>
<_MonoAotCrossFilePath Condition="'$(TargetsiOS)' == 'true' and '$(Platform)' == 'arm'">$(MonoObjDir)cross\out\bin\arm-darwin-mono-sgen</_MonoAotCrossFilePath>
</PropertyGroup>
<!-- Copy Mono runtime files to artifacts directory -->
<ItemGroup>
<_MonoRuntimeArtifacts Include="$(_MonoRuntimeFilePath)">
<Destination>$(BinDir)$(MonoFileName)</Destination>
</_MonoRuntimeArtifacts>
<_MonoRuntimeArtifacts Include="$(_MonoRuntimeStaticFilePath)">
<Destination>$(BinDir)$(MonoStaticFileName)</Destination>
</_MonoRuntimeArtifacts>
<_MonoRuntimeArtifacts Include="$(_MonoAotCrossFilePath)">
<Destination>$(BinDir)cross\mono-aot-cross</Destination>
</_MonoRuntimeArtifacts>
<_MonoIncludeArtifacts Include="$(MonoObjDir)out\include\**" />
</ItemGroup>
<Copy SourceFiles="@(_MonoRuntimeArtifacts)"
DestinationFiles="%(_MonoRuntimeArtifacts.Destination)"
SkipUnchangedFiles="true" />
<Copy SourceFiles="@(_MonoIncludeArtifacts)"
DestinationFiles="@(_MonoIncludeArtifacts->'$(BinDir)include\%(RecursiveDir)%(Filename)%(Extension)')"
SkipUnchangedFiles="true"
Condition="'$(TargetsiOS)' == 'true'"/>
<Exec Condition="'$(TargetsOSX)' == 'true' or '$(TargetsiOS)' == 'true'" Command="install_name_tool -id @rpath/$(MonoFileName) $(BinDir)$(MonoFileName)" />
</Target>
<Target Name="Restore">
<MSBuild Projects="$(MonoProjectRoot)netcore\nuget\packages.builds" Targets="Restore" />
<MSBuild Condition="'$(MonoEnableLLVM)' == 'true' and '$(MonoLLVMDir)' == '$(MonoObjDir)llvm'" Projects="$(MonoProjectRoot)llvm\llvm-init.proj" Targets="Restore" Properties="MonoObjDir=$(MonoObjDir);MonoLLVMDir=$(MonoLLVMDir)" />
</Target>
<Target Name="Pack">
<MSBuild Projects="$(MonoProjectRoot)netcore\nuget\packages.builds" Targets="Build" />
</Target>
<Target Name="Test" />
<!-- Precompile (AssembliesToPrecompile) using (MonoExec) -->
<Target Name="PrecompileAssembly">
<PropertyGroup>
<EnvVars Condition="'$(OS)' == 'Windows_NT'">set MONO_ENV_OPTIONS=--aot=mcpu=native & $(EnvVars)</EnvVars>
<EnvVars Condition="'$(OS)' != 'Windows_NT'">export MONO_ENV_OPTIONS=--aot=mcpu=native && $(EnvVars)</EnvVars>
</PropertyGroup>
<Exec Command="$(EnvVars) $(MonoExec) %(AssembliesToPrecompile.Identity)" ContinueOnError="WarnAndContinue" />
</Target>
<!-- Precompile (AOT) managed libs in .dotnet-mono\shared\Microsoft.NETCore.App\**\*.dll -->
<Target Name="PrecompileLocalMonoDotnetBcl" DependsOnTargets="PrepareLocalMonoDotnetBclForAot;PrecompileAssembly" />
<Target Name="PrepareLocalMonoDotnetBclForAot" DependsOnTargets="PatchLocalMonoDotnet">
<PropertyGroup>
<MonoExec>$(LocalMonoDotnet)</MonoExec>
</PropertyGroup>
<ItemGroup>
<AssembliesToPrecompile
Include="$(LocalMonoDotnetDir)\shared\Microsoft.NETCore.App\**\*.dll"
Exclude="$(LocalMonoDotnetDir)\shared\Microsoft.NETCore.App\**\System.Runtime.WindowsRuntime.dll" />
</ItemGroup>
</Target>
<!-- Precompile (AOT) $(ArtifactsDir)bin\**\*Tests\**\System.*.dll -->
<Target Name="PrecompileLibrariesTests" DependsOnTargets="PrepareLibrariesTestsForAot;PrecompileAssembly" />
<Target Name="PrepareLibrariesTestsForAot" DependsOnTargets="PatchLibrariesTesthost">
<PropertyGroup>
<MonoExec>$(LibrariesTesthostRoot)$(DotNetExec)</MonoExec>
</PropertyGroup>
<ItemGroup>
<AssembliesToPrecompile
Include="$(ArtifactsDir)bin\**\*Tests\**\System.*.dll" />
</ItemGroup>
</Target>
<!-- Precompile (AOT) $(ArtifactsDir)bin\**\*Tests\**\System.*.dll -->
<Target Name="PrecompileTesthostLibraries" DependsOnTargets="PrepareTesthostLibrariesForAot;PrecompileAssembly" />
<Target Name="PrepareTesthostLibrariesForAot" DependsOnTargets="PatchLibrariesTesthost">
<PropertyGroup>
<MonoExec>$(LibrariesTesthostRoot)$(DotNetExec)</MonoExec>
</PropertyGroup>
<ItemGroup>
<AssembliesToPrecompile
Include="$(LibrariesTesthostRuntimeDir)\System.*.dll" />
</ItemGroup>
</Target>
<!-- Copy Mono runtime bits to $(Destination) -->
<Target Name="CopyMonoRuntimeFilesFromArtifactsToDestination">
<ItemGroup>
<_MonoRuntimeArtifacts Include="$(BinDir)\*.*" />
</ItemGroup>
<Error Condition="'$(Destination)' == ''" Text="Destination should not be empty" />
<Error Condition="@(_MonoRuntimeArtifacts->Count()) < 2" Text="Mono artifacts were not found at $(BinDir)" />
<Message Text="Copying Mono Runtime artifacts from '$(BinDir)' to '$(Destination)'.'" Importance="High" />
<Copy SourceFiles="@(_MonoRuntimeArtifacts)"
DestinationFolder="$(Destination)"
OverwriteReadOnlyFiles="true" />
</Target>
<Target Name="CloneLocalDotnet" DependsOnTargets="ValidateLocalDotnet">
<ItemGroup>
<_LocalDotnetFiles Include="$(LocalDotnetDir)\**\*.*" />
</ItemGroup>
<!-- copy .dotnet to .dotnet-mono if it doesn't exist -->
<Copy SourceFiles="@(_LocalDotnetFiles)"
DestinationFolder="$(LocalMonoDotnetDir)\%(RecursiveDir)"
SkipUnchangedFiles="true" />
</Target>
<!-- Copy Mono runtime bits to the local .dotnet-mono (clone of .dotnet) dir for local experiments (temp solution) -->
<Target Name="PatchLocalMonoDotnet" DependsOnTargets="CloneLocalDotnet">
<MSBuild Projects ="$(MSBuildProjectFullPath)"
Properties="Destination=$([System.IO.Directory]::GetDirectories('$(LocalMonoDotnetDir)\shared\Microsoft.NETCore.App')[0])"
Targets="CopyMonoRuntimeFilesFromArtifactsToDestination" />
</Target>
<!-- Copy Mono runtime bits to the coreclr's Core_Root in order to run runtime tests -->
<Target Name="PatchCoreClrCoreRoot" DependsOnTargets="ValidateLocalDotnet">
<MSBuild Projects="$(MSBuildProjectFullPath)"
Properties="Destination=$(CoreClrTestCoreRoot)"
Targets="CopyMonoRuntimeFilesFromArtifactsToDestination" />
</Target>
<!-- Copy Mono runtime bits to the coreclr's Core_Root in order to run runtime tests -->
<Target Name="PatchLibrariesTesthost" DependsOnTargets="ValidateLocalDotnet">
<MSBuild Projects="$(MSBuildProjectFullPath)"
Properties="Destination=$(LibrariesTesthostRuntimeDir)"
Targets="CopyMonoRuntimeFilesFromArtifactsToDestination" />
</Target>
<!-- Copy Coreclr runtime bits back to Core_Root -->
<Target Name="RestoreCoreClrCoreRoot" DependsOnTargets="ValidateLocalDotnet">
<Copy SourceFiles="$(CoreCLRArtifactsPath)\System.Private.CoreLib.dll"
DestinationFiles="$(CoreClrTestCoreRoot)\System.Private.CoreLib.dll" />
<Copy SourceFiles="$(CoreCLRArtifactsPath)\$(CoreClrFileName)"
DestinationFiles="$(CoreClrTestCoreRoot)\$(CoreClrFileName)" />
</Target>
<!-- Run netcore\sample\HelloWorld sample using Mono Runtime -->
<Target Name="RunSample" DependsOnTargets="PatchLocalMonoDotnet">
<PropertyGroup>
<SampleDir>$(MonoProjectRoot)netcore\sample\HelloWorld</SampleDir>
<EnvVars Condition="'$(OS)' == 'Windows_NT'">set COMPlus_DebugWriteToStdErr=1 & $(EnvVars)</EnvVars>
<EnvVars Condition="'$(OS)' != 'Windows_NT'">export COMPlus_DebugWriteToStdErr=1 && $(EnvVars)</EnvVars>
</PropertyGroup>
<Exec Command="$(EnvVars) $(LocalMonoDotnet) run -c $(Configuration) -p $(SampleDir)" />
</Target>
<!-- Run CoreCLR runtime test using testhost -->
<Target Name="RunCoreClrTest" DependsOnTargets="ValidateLocalDotnet;PatchCoreClrCoreRoot">
<Error Condition="$(CoreClrTest) == ''" Text="'CoreClrTest' is not set. E.g. set it to `$(ArtifactsDir)tests/coreclr/$(TargetOS).$(Platform).$(CoreClrTestConfig)/JIT/opt/InstructionCombining/DivToMul/DivToMul$(ScriptExt)` in order to run DivToMul test." />
<Exec Command="$(CoreClrTest) -coreroot="$(CoreClrTestCoreRoot)""/>
</Target>
<!-- Run coreclr tests using runtest.py -->
<Target Name="RunCoreClrTests" DependsOnTargets="ValidateLocalDotnet;PatchCoreClrCoreRoot">
<Exec Condition="'$(OS)' == 'Windows_NT'" Command="$(MonoProjectRoot)..\coreclr\tests\runtest.cmd $(CoreClrTestConfig)" ContinueOnError="ErrorAndContinue" />
<Exec Condition="'$(OS)' != 'Windows_NT'" Command="$(MonoProjectRoot)../coreclr/tests/./runtest.sh $(CoreClrTestConfig)" ContinueOnError="ErrorAndContinue" />
</Target>
<!-- Run Libraries tests using testhost -->
<Target Name="RunLibrariesTest" DependsOnTargets="PatchLibrariesTesthost">
<Error Condition="$(LibraryToTest) == ''" Text="LibraryToTest variable is not set" />
<Error Condition="$(LibraryToTest.EndsWith('.Tests'))" Text="LibraryToTest should not end with .Tests, e.g. just 'System.Runtime'" />
<MSBuild Projects="$(RepoRoot)src\libraries\$(LibraryToTest)\tests\$(LibraryToTest).Tests.csproj"
Properties="Configuration=$(LibrariesTestConfig)" Targets="Test" />
</Target>
<Target Name="RunBenchmarks" DependsOnTargets="PatchLocalMonoDotnet">
<Error Condition="$(BenchmarksRepo) == ''" Text="BenchmarksRepo variable is not set" />
<Exec WorkingDirectory="$(BenchmarksRepo)\src\benchmarks\micro" Command="$(LocalDotnet) run -c Release -f $(NetCoreAppCurrent) --cli $(LocalMonoDotnet)" />
</Target>
<Target Name="ValidateLocalDotnet">
<Error Condition="$([System.IO.Directory]::GetDirectories('$(LocalDotnetDir)\shared\Microsoft.NETCore.App').Length) > 1" Text="$(LocalDotnetDir) contains more than one SDK, please delete unused ones." />
<Error Condition="$([System.IO.Directory]::GetDirectories('$(LocalMonoDotnetDir)\shared\Microsoft.NETCore.App').Length) > 1" Text="$(LocalMonoDotnetDir) contains more than one SDK, please delete unused ones." />
<Error Condition="!Exists('$(LocalDotnet)')" Text="'$(LocalDotnet)' doesn't exist." />
</Target>
</Project>