[Tizen] Implement ASan wrapper for Linux ARM32
[platform/upstream/dotnet/runtime.git] / src / coreclr / vm / CMakeLists.txt
1 set(CMAKE_INCLUDE_CURRENT_DIR ON)
2
3 # Needed due to the cmunged files being in the binary folders, the set(CMAKE_INCLUDE_CURRENT_DIR ON) is not enough
4 include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
5 include_directories(${ARCH_SOURCES_DIR})
6 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../interop/inc)
7
8 # needed when zLib compression is used
9 include_directories(${CLR_SRC_LIBS_NATIVE_DIR}/AnyOS/zlib)
10 if(NOT CLR_CMAKE_TARGET_WIN32)
11     include_directories(${CLR_SRC_LIBS_NATIVE_DIR}/Unix/Common)
12 endif()
13
14 add_definitions(-DUNICODE)
15 add_definitions(-D_UNICODE)
16
17 if(FEATURE_AUTO_TRACE)
18     add_definitions(-DFEATURE_AUTO_TRACE)
19 endif(FEATURE_AUTO_TRACE)
20
21 foreach (Config DEBUG CHECKED)
22     add_compile_definitions($<$<CONFIG:${Config}>:WRITE_BARRIER_CHECK>)
23 endforeach (Config)
24
25 if(FEATURE_GDBJIT)
26     set(VM_SOURCES_GDBJIT
27         gdbjit.cpp
28     )
29     set(VM_HEADERS_GDBJIT
30         gdbjit.h
31     )
32 endif(FEATURE_GDBJIT)
33
34 if(FEATURE_JIT_PITCHING)
35    add_definitions(-DFEATURE_JIT_PITCHING)
36 endif(FEATURE_JIT_PITCHING)
37
38 if(FEATURE_PERFTRACING)
39     set(SHARED_EVENTPIPE_DIR ${CLR_SRC_NATIVE_DIR}/eventpipe)
40     set(CORECLR_EVENTPIPE_SHIM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/eventing/eventpipe)
41 endif(FEATURE_PERFTRACING)
42
43 if(FEATURE_PERFTRACING)
44     include_directories(${SHARED_EVENTPIPE_DIR})
45     include_directories(${CORECLR_EVENTPIPE_SHIM_DIR})
46 endif(FEATURE_PERFTRACING)
47
48 set(VM_SOURCES_DAC_AND_WKS_COMMON
49     appdomain.cpp
50     array.cpp
51     assembly.cpp
52     assemblyloadcontext.cpp
53     binder.cpp
54     bundle.cpp
55     castcache.cpp
56     callcounting.cpp
57     ceeload.cpp
58     class.cpp
59     classhash.cpp
60     classlayoutinfo.cpp
61     clsload.cpp
62     codeman.cpp
63     codeversion.cpp
64     contractimpl.cpp
65     corhost.cpp
66     crst.cpp
67     debugdebugger.cpp
68     debughelp.cpp
69     debuginfostore.cpp
70     decodemd.cpp
71     disassembler.cpp
72     domainfile.cpp
73     dynamicmethod.cpp
74     ecall.cpp
75     eedbginterfaceimpl.cpp
76     eehash.cpp
77     eetwain.cpp
78     encee.cpp
79     excep.cpp
80     exstate.cpp
81     field.cpp
82     formattype.cpp
83     fptrstubs.cpp
84     frames.cpp
85     gctoclreventsink.cpp
86     gcheaputilities.cpp
87     gchandleutilities.cpp
88     genericdict.cpp
89     generics.cpp
90     hash.cpp
91     hillclimbing.cpp
92     ilinstrumentation.cpp
93     ilstubcache.cpp
94     ilstubresolver.cpp
95     inlinetracking.cpp
96     instmethhash.cpp
97     jithost.cpp
98     jitinterface.cpp
99     loaderallocator.cpp
100     memberload.cpp
101     method.cpp
102     methoddescbackpatchinfo.cpp
103     methodimpl.cpp
104     methoditer.cpp
105     methodtable.cpp
106     nativeimage.cpp
107     object.cpp
108     onstackreplacement.cpp
109     pefile.cpp
110     peimage.cpp
111     perfmap.cpp
112     perfinfo.cpp
113     pgo.cpp
114     precode.cpp
115     prestub.cpp
116     rejit.cpp
117     sigformat.cpp
118     siginfo.cpp
119     spinlock.cpp
120     stackwalk.cpp
121     stublink.cpp
122     stubmgr.cpp
123     syncblk.cpp
124     threadpoolrequest.cpp
125     threads.cpp
126     threadstatics.cpp
127     tieredcompilation.cpp
128     typectxt.cpp
129     typedesc.cpp
130     typeequivalencehash.cpp
131     typehandle.cpp
132     typehash.cpp
133     typestring.cpp
134     util.cpp
135     vars.cpp
136     versionresilienthashcode.cpp
137     virtualcallstub.cpp
138     win32threadpool.cpp
139     zapsig.cpp
140 )
141
142 set(VM_HEADERS_DAC_AND_WKS_COMMON
143     ../inc/corjit.h
144     ../inc/corjitflags.h
145     ../inc/corjithost.h
146     appdomain.hpp
147     appdomain.inl
148     array.h
149     assembly.hpp
150     assemblyloadcontext.h
151     binder.h
152     castcache.h
153     callcounting.h
154     ceeload.h
155     ceeload.inl
156     class.h
157     class.inl
158     classhash.h
159     clsload.hpp
160     clsload.inl
161     codeman.h
162     codeman.inl
163     codeversion.h
164     contractimpl.h
165     crst.h
166     debugdebugger.h
167     debuginfostore.h
168     decodemd.h
169     disassembler.h
170     domainfile.h
171     domainfile.inl
172     dynamicmethod.h
173     ecall.h
174     eedbginterfaceimpl.h
175     eedbginterfaceimpl.inl
176     eehash.h
177     eehash.inl
178     encee.h
179     excep.h
180     exstate.h
181     field.h
182     fptrstubs.h
183     frames.h
184     gccover.h
185     gctoclreventsink.h
186     gcheaputilities.h
187     generics.h
188     hash.h
189     hillclimbing.h
190     ilinstrumentation.h
191     ilstubcache.h
192     ilstubresolver.h
193     inlinetracking.h
194     instmethhash.h
195     jithost.h
196     jitinterface.h
197     loaderallocator.hpp
198     loaderallocator.inl
199     memberload.h
200     method.hpp
201     method.inl
202     methoddescbackpatchinfo.h
203     methodimpl.h
204     methoditer.h
205     methodtable.h
206     methodtable.inl
207     object.h
208     object.inl
209     onstackreplacement.h
210     pefile.h
211     pefile.inl
212     peimage.h
213     peimage.inl
214     peimagelayout.h
215     peimagelayout.inl
216     perfmap.h
217     perfinfo.h
218     pgo.h
219     precode.h
220     rejit.h
221     rejit.inl
222     sigformat.h
223     siginfo.hpp
224     spinlock.h
225     stackwalk.h
226     stublink.h
227     stublink.inl
228     stubmgr.h
229     syncblk.h
230     syncblk.inl
231     threadpoolrequest.h
232     threads.h
233     threads.inl
234     threadstatics.h
235     typectxt.h
236     typedesc.h
237     typedesc.inl
238     typeequivalencehash.hpp
239     typehandle.h
240     typehandle.inl
241     typehash.h
242     typehashingalgorithms.h
243     typestring.h
244     util.hpp
245     vars.hpp
246     versionresilienthashcode.h
247     virtualcallstub.h
248     win32threadpool.h
249     zapsig.h
250 )
251
252 set( GC_SOURCES_DAC_AND_WKS_COMMON
253   ../gc/handletable.cpp
254   ../gc/handletablecore.cpp
255   ../gc/handletablescan.cpp
256   ../gc/objecthandle.cpp)
257
258 set( GC_HEADERS_DAC_AND_WKS_COMMON
259     ../gc/handletable.h
260     ../gc/handletable.inl
261     ../gc/handletablepriv.h
262     ../gc/objecthandle.h)
263
264 if(FEATURE_READYTORUN)
265     list(APPEND VM_SOURCES_DAC_AND_WKS_COMMON
266         readytoruninfo.cpp
267     )
268     list(APPEND VM_HEADERS_DAC_AND_WKS_COMMON
269         readytoruninfo.h
270     )
271 endif(FEATURE_READYTORUN)
272
273 if(FEATURE_JIT_PITCHING)
274     list(APPEND VM_SOURCES_DAC_AND_WKS_COMMON
275         codepitchingmanager.cpp
276     )
277 endif(FEATURE_JIT_PITCHING)
278
279 set(VM_SOURCES_DAC
280     ${VM_SOURCES_DAC_AND_WKS_COMMON}
281     threaddebugblockinginfo.cpp
282 )
283
284 set(VM_HEADERS_DAC
285     ${VM_HEADERS_DAC_AND_WKS_COMMON}
286     threaddebugblockinginfo.h
287 )
288
289 set(GC_SOURCES_DAC
290     ${GC_SOURCES_DAC_AND_WKS_COMMON})
291
292 set(GC_HEADERS_DAC
293     ${GC_HEADERS_DAC_AND_WKS_COMMON})
294
295 set(VM_SOURCES_WKS
296     ${VM_SOURCES_DAC_AND_WKS_COMMON}
297     appdomainnative.cpp
298     assemblyname.cpp
299     assemblynative.cpp
300     assemblyspec.cpp
301     baseassemblyspec.cpp
302     cachelinealloc.cpp
303     callconvbuilder.cpp
304     callhelpers.cpp
305     callsiteinspect.cpp
306     clrconfignative.cpp
307     clrex.cpp
308     clrvarargs.cpp
309     comdatetime.cpp
310     comdelegate.cpp
311     comdependenthandle.cpp
312     comdynamic.cpp
313     commodule.cpp
314     compatibilityswitch.cpp
315     comsynchronizable.cpp
316     comthreadpool.cpp
317     comutilnative.cpp
318     comwaithandle.cpp
319     coreassemblyspec.cpp
320     corebindresult.cpp
321     corelib.cpp # <DisablePrecompiledHeaders>true</DisablePrecompiledHeaders>
322     customattribute.cpp
323     custommarshalerinfo.cpp
324     autotrace.cpp
325     dllimport.cpp
326     dllimportcallback.cpp
327     dynamicinterfacecastable.cpp
328     eeconfig.cpp
329     eecontract.cpp
330     eemessagebox.cpp
331     eepolicy.cpp
332     eetoprofinterfaceimpl.cpp
333     eventpipeinternal.cpp
334     eventstore.cpp
335     fcall.cpp
336     fieldmarshaler.cpp
337     finalizerthread.cpp
338     gccover.cpp
339     gcenv.ee.static.cpp
340     gcenv.ee.common.cpp
341     gcenv.os.cpp
342     gchelpers.cpp
343     genanalysis.cpp
344     genmeth.cpp
345     hosting.cpp
346     ibclogger.cpp
347     ilmarshalers.cpp
348     interopconverter.cpp
349     interoputil.cpp
350     interpreter.cpp
351     invokeutil.cpp
352     jithelpers.cpp
353     managedmdimport.cpp
354     marshalnative.cpp
355     methodtablebuilder.cpp
356     mlinfo.cpp
357     multicorejit.cpp # Condition="'$(FeatureMulticoreJIT)' == 'true'
358     multicorejitplayer.cpp # Condition="'$(FeatureMulticoreJIT)' == 'true'
359     nativeeventsource.cpp
360     nativeoverlapped.cpp
361     nativelibrary.cpp
362     nativelibrarynative.cpp
363     objectlist.cpp
364     olevariant.cpp
365     pendingload.cpp
366     pinvokeoverride.cpp
367     profdetach.cpp
368     profilermetadataemitvalidator.cpp
369     profilingenumerators.cpp
370     profilinghelper.cpp
371     proftoeeinterfaceimpl.cpp
372     qcall.cpp
373     reflectclasswriter.cpp
374     reflectioninvocation.cpp
375     runtimehandles.cpp
376     safehandle.cpp
377     simplerwlock.cpp
378     sourceline.cpp
379     stackingallocator.cpp
380     stringliteralmap.cpp
381     stubcache.cpp
382     stubgen.cpp
383     stubhelpers.cpp
384     syncclean.cpp
385     synch.cpp
386     tailcallhelp.cpp
387     threaddebugblockinginfo.cpp
388     threadsuspend.cpp
389     typeparse.cpp
390     weakreferencenative.cpp
391     yieldprocessornormalized.cpp
392     ${VM_SOURCES_GDBJIT}
393 )
394
395 # coreclr needs to compile codeman.cpp differently depending on flavor (i.e. dll vs. static lib))
396 list(REMOVE_ITEM VM_SOURCES_WKS codeman.cpp)
397
398 set(VM_HEADERS_WKS
399     ${VM_HEADERS_DAC_AND_WKS_COMMON}
400     ../inc/jithelpers.h
401     coreclr/corebindresult.h
402     coreclr/corebindresult.inl
403     appdomainnative.hpp
404     assemblyname.hpp
405     assemblynative.hpp
406     assemblyspec.hpp
407     assemblyspecbase.h
408     baseassemblyspec.h
409     baseassemblyspec.inl
410     cachelinealloc.h
411     callhelpers.h
412     callsiteinspect.h
413     callconvbuilder.hpp
414     ceemain.h
415     clrconfignative.h
416     clrex.h
417     clrvarargs.h
418     comdatetime.h
419     comdelegate.h
420     comdependenthandle.h
421     comdynamic.h
422     commodule.h
423     compatibilityswitch.h
424     comsynchronizable.h
425     comthreadpool.h
426     comutilnative.h
427     comwaithandle.h
428     customattribute.h
429     custommarshalerinfo.h
430     autotrace.h
431     diagnosticserveradapter.h
432     dllimport.h
433     dllimportcallback.h
434     eeconfig.h
435     eecontract.h
436     eemessagebox.h
437     eepolicy.h
438     eeprofinterfaces.h
439     eeprofinterfaces.inl
440     eetoprofinterfaceimpl.h
441     eetoprofinterfaceimpl.inl
442     eventpipeadapter.h
443     eventpipeadaptertypes.h
444     eventpipeinternal.h
445     eventstore.hpp
446     fcall.h
447     fieldmarshaler.h
448     finalizerthread.h
449     gcenv.h
450     gcenv.ee.h
451     gcenv.os.h
452     gchelpers.h
453     ibclogger.h
454     ilmarshalers.h
455     interopconverter.h
456     interoputil.h
457     interoputil.inl
458     interpreter.h
459     interpreter.hpp
460     invokeutil.h
461     managedmdimport.hpp
462     marshalnative.h
463     methodtablebuilder.h
464     mlinfo.h
465     corelib.h
466     multicorejit.h
467     multicorejitimpl.h
468     nativeeventsource.h
469     nativeoverlapped.h
470     nativelibrarynative.h
471     objectlist.h
472     olevariant.h
473     pendingload.h
474     profdetach.h
475     profilermetadataemitvalidator.h
476     profilingenumerators.h
477     profilinghelper.h
478     proftoeeinterfaceimpl.h
479     proftoeeinterfaceimpl.inl
480     qcall.h
481     reflectclasswriter.h
482     reflectioninvocation.h
483     runtimehandles.h
484     simplerwlock.hpp
485     sourceline.h
486     stackingallocator.h
487     stringliteralmap.h
488     stubcache.h
489     stubgen.h
490     stubhelpers.h
491     syncclean.hpp
492     synch.h
493     tailcallhelp.h
494     tieredcompilation.h
495     threaddebugblockinginfo.h
496     threadsuspend.h
497     typeparse.h
498     weakreferencenative.h
499     ${VM_HEADERS_GDBJIT}
500 )
501
502 set(GC_SOURCES_WKS
503     ${GC_SOURCES_DAC_AND_WKS_COMMON}
504     ../gc/gceventstatus.cpp
505     ../gc/gcconfig.cpp
506     ../gc/gccommon.cpp
507     ../gc/gcscan.cpp
508     ../gc/gcsvr.cpp
509     ../gc/gcwks.cpp
510     ../gc/gchandletable.cpp
511     ../gc/gceesvr.cpp
512     ../gc/gceewks.cpp
513     ../gc/gcload.cpp
514     ../gc/softwarewritewatch.cpp
515     ../gc/handletablecache.cpp)
516
517 if (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32)
518   set ( GC_SOURCES_WKS
519     ${GC_SOURCES_WKS}
520     ../gc/vxsort/isa_detection.cpp
521     ../gc/vxsort/do_vxsort_avx2.cpp
522     ../gc/vxsort/do_vxsort_avx512.cpp
523     ../gc/vxsort/machine_traits.avx2.cpp
524     ../gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.cpp
525     ../gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.cpp
526     ../gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.cpp
527     ../gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.cpp
528     ../gc/vxsort/smallsort/avx2_load_mask_tables.cpp
529 )
530 endif (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32)
531
532 set(GC_HEADERS_WKS
533     ${GC_HEADERS_DAC_AND_WKS_COMMON}
534     ../gc/gceventstatus.h
535     ../gc/gcconfig.h
536     ../gc/gcscan.h
537     ../gc/gchandletableimpl.h
538     ../gc/softwarewritewatch.h)
539
540 if(FEATURE_EVENT_TRACE)
541     list(APPEND VM_SOURCES_WKS
542         eventtrace.cpp
543         )
544     list(APPEND VM_HEADERS_WKS
545         eventtracepriv.h
546         )
547 endif(FEATURE_EVENT_TRACE)
548
549 if(FEATURE_STANDALONE_GC)
550     list(APPEND VM_SOURCES_WKS
551         gcenv.ee.standalone.cpp
552         )
553 endif(FEATURE_STANDALONE_GC)
554
555 #
556 # Targeted interop scenarios
557 #
558 # Shared assets
559 list(APPEND VM_SOURCES_WKS
560     interoplibinterface_shared.cpp
561 )
562 list(APPEND VM_HEADERS_WKS
563     interoplibinterface.h
564 )
565
566 if(FEATURE_COMWRAPPERS)
567     list(APPEND VM_SOURCES_WKS
568         interoplibinterface_comwrappers.cpp
569         rcwrefcache.cpp
570     )
571     list(APPEND VM_HEADERS_WKS
572         rcwrefcache.h
573     )
574 endif(FEATURE_COMWRAPPERS)
575
576 if(FEATURE_OBJCMARSHAL)
577     list(APPEND VM_SOURCES_WKS
578         interoplibinterface_objc.cpp
579     )
580 endif(FEATURE_OBJCMARSHAL)
581
582 if(CLR_CMAKE_TARGET_WIN32)
583
584     set(VM_SOURCES_DAC_AND_WKS_WIN32
585         amsi.cpp
586     )
587
588     set(VM_HEADERS_DAC_AND_WKS_WIN32
589         amsi.h
590     )
591
592     # COM interop scenarios
593     list(APPEND VM_SOURCES_DAC_AND_WKS_WIN32
594         clrtocomcall.cpp
595         )
596     list(APPEND VM_HEADERS_DAC_AND_WKS_WIN32
597         clrtocomcall.h
598         )
599
600     list(APPEND VM_SOURCES_WKS
601         ${VM_SOURCES_DAC_AND_WKS_WIN32}
602         # These should not be included for Linux
603         dwreport.cpp
604         eventreporter.cpp
605         rtlfunctions.cpp
606         stacksampler.cpp
607     )
608
609     list(APPEND VM_HEADERS_WKS
610         ${VM_HEADERS_DAC_AND_WKS_WIN32}
611         # These should not be included for Linux
612         dwreport.h
613         eventreporter.h
614         rtlfunctions.h
615         stacksampler.h
616     )
617
618     # COM interop scenarios
619     list(APPEND VM_SOURCES_WKS
620         classcompat.cpp
621         comcache.cpp
622         comcallablewrapper.cpp
623         comconnectionpoints.cpp
624         cominterfacemarshaler.cpp
625         commtmemberinfomap.cpp
626         comtoclrcall.cpp
627         dispatchinfo.cpp
628         dispparammarshaler.cpp
629         mngstdinterfaces.cpp
630         notifyexternals.cpp
631         olecontexthelpers.cpp
632         runtimecallablewrapper.cpp
633         stdinterfaces.cpp
634         stdinterfaces_wrapper.cpp
635         )
636     list(APPEND VM_HEADERS_WKS
637         classcompat.h
638         comcache.h
639         comcallablewrapper.h
640         comconnectionpoints.h
641         cominterfacemarshaler.h
642         commtmemberinfomap.h
643         comtoclrcall.h
644         dispatchinfo.h
645         dispparammarshaler.h
646         mngstdinterfaces.h
647         notifyexternals.h
648         olecontexthelpers.h
649         runtimecallablewrapper.h
650         stdinterfaces.h
651         stdinterfaces_internal.h
652         )
653
654     list(APPEND VM_SOURCES_DAC
655         ${VM_SOURCES_DAC_AND_WKS_WIN32}
656     )
657
658     list(APPEND VM_HEADERS_DAC
659         ${VM_HEADERS_DAC_AND_WKS_WIN32}
660     )
661
662 endif(CLR_CMAKE_TARGET_WIN32)
663
664 if(CLR_CMAKE_TARGET_WIN32)
665
666 if(CLR_CMAKE_TARGET_ARCH_AMD64)
667     set(VM_SOURCES_WKS_ARCH_ASM
668         ${ARCH_SOURCES_DIR}/AsmHelpers.asm
669         ${ARCH_SOURCES_DIR}/CallDescrWorkerAMD64.asm
670         ${ARCH_SOURCES_DIR}/ComCallPreStub.asm
671         ${ARCH_SOURCES_DIR}/CrtHelpers.asm
672         ${ARCH_SOURCES_DIR}/GenericComCallStubs.asm
673         ${ARCH_SOURCES_DIR}/GenericComPlusCallStubs.asm
674         ${ARCH_SOURCES_DIR}/getstate.asm
675         ${ARCH_SOURCES_DIR}/JitHelpers_Fast.asm
676         ${ARCH_SOURCES_DIR}/JitHelpers_FastWriteBarriers.asm
677         ${ARCH_SOURCES_DIR}/JitHelpers_InlineGetThread.asm
678         ${ARCH_SOURCES_DIR}/JitHelpers_SingleAppDomain.asm
679         ${ARCH_SOURCES_DIR}/JitHelpers_Slow.asm
680         ${ARCH_SOURCES_DIR}/PInvokeStubs.asm
681         ${ARCH_SOURCES_DIR}/RedirectedHandledJITCase.asm
682         ${ARCH_SOURCES_DIR}/ThePreStubAMD64.asm
683         ${ARCH_SOURCES_DIR}/Context.asm
684         ${ARCH_SOURCES_DIR}/ExternalMethodFixupThunk.asm
685         ${ARCH_SOURCES_DIR}/UMThunkStub.asm
686         ${ARCH_SOURCES_DIR}/VirtualCallStubAMD64.asm
687     )
688
689     set(VM_HEADERS_WKS_ARCH_ASM
690         ${ARCH_SOURCES_DIR}/asmconstants.h
691     )
692 elseif(CLR_CMAKE_TARGET_ARCH_I386)
693     set(VM_SOURCES_WKS_ARCH_ASM
694         ${ARCH_SOURCES_DIR}/RedirectedHandledJITCase.asm
695         ${ARCH_SOURCES_DIR}/asmhelpers.asm
696         ${ARCH_SOURCES_DIR}/gmsasm.asm
697         ${ARCH_SOURCES_DIR}/jithelp.asm
698         ${ARCH_SOURCES_DIR}/PInvokeStubs.asm
699     )
700
701     set(VM_HEADERS_WKS_ARCH_ASM
702         ${ARCH_SOURCES_DIR}/asmconstants.h
703     )
704 elseif(CLR_CMAKE_TARGET_ARCH_ARM)
705     set(VM_SOURCES_WKS_ARCH_ASM
706         ${ARCH_SOURCES_DIR}/asmhelpers.asm
707         ${ARCH_SOURCES_DIR}/CrtHelpers.asm
708         ${ARCH_SOURCES_DIR}/ehhelpers.asm
709         ${ARCH_SOURCES_DIR}/patchedcode.asm
710         ${ARCH_SOURCES_DIR}/PInvokeStubs.asm
711     )
712
713     set(VM_HEADERS_WKS_ARCH_ASM
714         ${ARCH_SOURCES_DIR}/asmconstants.h
715     )
716 elseif(CLR_CMAKE_TARGET_ARCH_ARM64)
717     set(VM_SOURCES_WKS_ARCH_ASM
718         ${ARCH_SOURCES_DIR}/AsmHelpers.asm
719         ${ARCH_SOURCES_DIR}/CallDescrWorkerARM64.asm
720         ${ARCH_SOURCES_DIR}/CrtHelpers.asm
721         ${ARCH_SOURCES_DIR}/PInvokeStubs.asm
722     )
723
724     set(VM_HEADERS_WKS_ARCH_ASM
725         ${ARCH_SOURCES_DIR}/asmconstants.h
726     )
727 endif()
728
729 else(CLR_CMAKE_TARGET_WIN32)
730     if (TIZEN_ASAN_ENVIRONMENT)
731         list(APPEND VM_SOURCES_WKS
732             tizenasanenv.cpp
733         )
734         list(APPEND VM_HEADERS_WKS
735             tizenasanenv.h
736         )
737     endif()
738
739     if(CLR_CMAKE_TARGET_ARCH_AMD64)
740         set(VM_SOURCES_WKS_ARCH_ASM
741             ${ARCH_SOURCES_DIR}/asmhelpers.S
742             ${ARCH_SOURCES_DIR}/calldescrworkeramd64.S
743             ${ARCH_SOURCES_DIR}/crthelpers.S
744             ${ARCH_SOURCES_DIR}/externalmethodfixupthunk.S
745             ${ARCH_SOURCES_DIR}/getstate.S
746             ${ARCH_SOURCES_DIR}/jithelpers_fast.S
747             ${ARCH_SOURCES_DIR}/jithelpers_fastwritebarriers.S
748             ${ARCH_SOURCES_DIR}/jithelpers_singleappdomain.S
749             ${ARCH_SOURCES_DIR}/jithelpers_slow.S
750             ${ARCH_SOURCES_DIR}/pinvokestubs.S
751             ${ARCH_SOURCES_DIR}/theprestubamd64.S
752             ${ARCH_SOURCES_DIR}/unixasmhelpers.S
753             ${ARCH_SOURCES_DIR}/umthunkstub.S
754             ${ARCH_SOURCES_DIR}/virtualcallstubamd64.S
755         )
756     elseif(CLR_CMAKE_TARGET_ARCH_I386)
757         set(VM_SOURCES_WKS_ARCH_ASM
758             ${ARCH_SOURCES_DIR}/ehhelpers.S
759             ${ARCH_SOURCES_DIR}/asmhelpers.S
760             ${ARCH_SOURCES_DIR}/jithelp.S
761             ${ARCH_SOURCES_DIR}/gmsasm.S
762             ${ARCH_SOURCES_DIR}/pinvokestubs.S
763             ${ARCH_SOURCES_DIR}/umthunkstub.S
764         )
765     elseif(CLR_CMAKE_TARGET_ARCH_ARM)
766         set(VM_SOURCES_WKS_ARCH_ASM
767             ${ARCH_SOURCES_DIR}/asmhelpers.S
768             ${ARCH_SOURCES_DIR}/crthelpers.S
769             ${ARCH_SOURCES_DIR}/ehhelpers.S
770             ${ARCH_SOURCES_DIR}/patchedcode.S
771             ${ARCH_SOURCES_DIR}/pinvokestubs.S
772         )
773         if (TIZEN_ASAN_ENVIRONMENT)
774             list(APPEND VM_SOURCES_WKS_ARCH_ASM
775                 ${ARCH_SOURCES_DIR}/tizenasanenv.S
776             )
777         endif()
778     elseif(CLR_CMAKE_TARGET_ARCH_ARM64)
779         set(VM_SOURCES_WKS_ARCH_ASM
780             ${ARCH_SOURCES_DIR}/asmhelpers.S
781             ${ARCH_SOURCES_DIR}/calldescrworkerarm64.S
782             ${ARCH_SOURCES_DIR}/crthelpers.S
783             ${ARCH_SOURCES_DIR}/pinvokestubs.S
784         )
785     endif()
786
787 endif(CLR_CMAKE_TARGET_WIN32)
788
789
790 if(CLR_CMAKE_TARGET_ARCH_AMD64)
791     set(VM_SOURCES_DAC_AND_WKS_ARCH
792         ${ARCH_SOURCES_DIR}/cgenamd64.cpp
793         ${ARCH_SOURCES_DIR}/excepamd64.cpp
794         ${ARCH_SOURCES_DIR}/gmsamd64.cpp
795         ${ARCH_SOURCES_DIR}/stublinkeramd64.cpp
796     )
797
798     set(VM_HEADERS_DAC_AND_WKS_ARCH
799         ${ARCH_SOURCES_DIR}/asmconstants.h
800         ${ARCH_SOURCES_DIR}/cgencpu.h
801         ${ARCH_SOURCES_DIR}/excepcpu.h
802         ${ARCH_SOURCES_DIR}/gmscpu.h
803         ${ARCH_SOURCES_DIR}/stublinkeramd64.h
804     )
805
806     set(VM_SOURCES_WKS_ARCH
807         ${ARCH_SOURCES_DIR}/jitinterfaceamd64.cpp
808         ${ARCH_SOURCES_DIR}/profiler.cpp
809         exceptionhandling.cpp
810         gcinfodecoder.cpp
811         jitinterfacegen.cpp
812     )
813
814     set(VM_HEADERS_WKS_ARCH
815         exceptionhandling.h
816     )
817 elseif(CLR_CMAKE_TARGET_ARCH_I386)
818     set(VM_SOURCES_DAC_AND_WKS_ARCH
819         exinfo.cpp
820         ${ARCH_SOURCES_DIR}/cgenx86.cpp
821         ${ARCH_SOURCES_DIR}/excepx86.cpp
822         ${ARCH_SOURCES_DIR}/gmsx86.cpp
823         ${ARCH_SOURCES_DIR}/stublinkerx86.cpp
824     )
825
826     set(VM_HEADERS_DAC_AND_WKS_ARCH
827         exinfo.h
828         ${ARCH_SOURCES_DIR}/cgencpu.h
829         ${ARCH_SOURCES_DIR}/excepcpu.h
830         ${ARCH_SOURCES_DIR}/gmscpu.h
831         ${ARCH_SOURCES_DIR}/stublinkerx86.h
832     )
833
834     set(VM_SOURCES_WKS_ARCH
835         ${ARCH_SOURCES_DIR}/jitinterfacex86.cpp
836         ${ARCH_SOURCES_DIR}/profiler.cpp
837         exceptionhandling.cpp
838         gcinfodecoder.cpp
839     )
840
841     set(VM_HEADERS_WKS_ARCH
842         exceptionhandling.h
843     )
844 elseif(CLR_CMAKE_TARGET_ARCH_ARM)
845     set(VM_SOURCES_DAC_AND_WKS_ARCH
846         ${ARCH_SOURCES_DIR}/exceparm.cpp
847         ${ARCH_SOURCES_DIR}/stubs.cpp
848     )
849
850     set(VM_HEADERS_DAC_AND_WKS_ARCH
851         ${ARCH_SOURCES_DIR}/asmconstants.h
852         ${ARCH_SOURCES_DIR}/excepcpu.h
853         ${ARCH_SOURCES_DIR}/virtualcallstubcpu.hpp
854     )
855
856     set(VM_SOURCES_WKS_ARCH
857         ${ARCH_SOURCES_DIR}/profiler.cpp
858         ${ARCH_SOURCES_DIR}/armsinglestepper.cpp
859         exceptionhandling.cpp
860         gcinfodecoder.cpp
861     )
862
863     set(VM_HEADERS_WKS_ARCH
864         exceptionhandling.h
865     )
866 elseif(CLR_CMAKE_TARGET_ARCH_ARM64)
867     set(VM_SOURCES_DAC_AND_WKS_ARCH
868         ${ARCH_SOURCES_DIR}/stubs.cpp
869         exceptionhandling.cpp
870     )
871
872     set(VM_HEADERS_DAC_AND_WKS_ARCH
873         ${ARCH_SOURCES_DIR}/virtualcallstubcpu.hpp
874         exceptionhandling.h
875     )
876
877     set(VM_SOURCES_WKS_ARCH
878         ${ARCH_SOURCES_DIR}/profiler.cpp
879         gcinfodecoder.cpp
880     )
881
882     if(CLR_CMAKE_HOST_UNIX)
883         list(APPEND VM_SOURCES_WKS_ARCH
884             ${ARCH_SOURCES_DIR}/arm64singlestepper.cpp
885         )
886     endif(CLR_CMAKE_HOST_UNIX)
887 endif()
888
889 if(CLR_CMAKE_HOST_UNIX)
890     list(APPEND VM_SOURCES_WKS_ARCH
891         ${ARCH_SOURCES_DIR}/unixstubs.cpp
892     )
893 endif(CLR_CMAKE_HOST_UNIX)
894
895 set(VM_SOURCES_DAC_ARCH
896     exceptionhandling.cpp
897 )
898
899 set(VM_HEADERS_DAC_ARCH
900     exceptionhandling.h
901 )
902
903 list(APPEND VM_SOURCES_WKS
904     ${VM_SOURCES_WKS_ARCH}
905     ${VM_SOURCES_DAC_AND_WKS_ARCH}
906 )
907
908 list(APPEND VM_HEADERS_WKS
909     ${VM_HEADERS_WKS_ARCH}
910     ${VM_HEADERS_DAC_AND_WKS_ARCH}
911 )
912
913 list(APPEND VM_SOURCES_DAC
914     ${VM_SOURCES_DAC_ARCH}
915     ${VM_SOURCES_DAC_AND_WKS_ARCH}
916 )
917
918 list(APPEND VM_HEADERS_DAC
919     ${VM_HEADERS_DAC_ARCH}
920     ${VM_HEADERS_DAC_AND_WKS_ARCH}
921 )
922
923 list(APPEND VM_SOURCES_WKS
924      ${GC_SOURCES_WKS}
925 )
926
927 list(APPEND VM_HEADERS_WKS
928      ${GC_HEADERS_WKS}
929 )
930
931 # The DAC does need GC sources in order to link correctly, even if
932 # it's not used.
933 list(APPEND VM_SOURCES_DAC
934     ${GC_SOURCES_DAC}
935 )
936
937 list(APPEND VM_HEADERS_DAC
938     ${GC_HEADERS_DAC}
939 )
940
941 if (CLR_CMAKE_TARGET_WIN32)
942     list(APPEND VM_SOURCES_WKS ${VM_HEADERS_WKS})
943     list(APPEND VM_SOURCES_WKS ${VM_HEADERS_WKS_ARCH_ASM})
944     list(APPEND VM_SOURCES_DAC ${VM_HEADERS_DAC})
945 endif(CLR_CMAKE_TARGET_WIN32)
946
947 # these two files we need to compile differently for standalone and mergeable flavors of WKS
948 set (VM_SOURCES_WKS_SPECIAL
949     codeman.cpp
950     ceemain.cpp
951     peimagelayout.cpp
952 )
953
954 list(APPEND VM_SOURCES_DAC
955     peimagelayout.cpp
956 )
957
958 # gcdecode.cpp is included by both JIT and VM. to avoid duplicate definitions we need to
959 # treat it in a special way when statically linking with both VM and JIT
960 if(CLR_CMAKE_TARGET_ARCH_I386)
961     if(CLR_CMAKE_TARGET_WIN32)
962         list(APPEND VM_SOURCES_DAC
963             gcdecode.cpp
964         )
965     endif()
966     list(APPEND VM_SOURCES_WKS_SPECIAL
967         gcdecode.cpp
968     )
969 endif()
970
971 convert_to_absolute_path(VM_SOURCES_WKS ${VM_SOURCES_WKS})
972 convert_to_absolute_path(VM_SOURCES_WKS_ARCH_ASM ${VM_SOURCES_WKS_ARCH_ASM})
973 convert_to_absolute_path(VM_SOURCES_DAC ${VM_SOURCES_DAC})
974 convert_to_absolute_path(VM_SOURCES_WKS_SPECIAL ${VM_SOURCES_WKS_SPECIAL})
975
976 add_library_clr(cee_dac ${VM_SOURCES_DAC})
977 add_dependencies(cee_dac eventing_headers)
978 set_target_properties(cee_dac PROPERTIES DAC_COMPONENT TRUE)
979 target_precompile_headers(cee_dac PRIVATE [["common.h"]])
980
981 add_subdirectory(wks)
982
983 if(FEATURE_PERFTRACING)
984     add_subdirectory(eventing)
985 endif(FEATURE_PERFTRACING)