Merge pull request #13450 from sjsinju/genisvaliddoublereg
[platform/upstream/coreclr.git] / clrdefinitions.cmake
1 include(clrfeatures.cmake)
2
3 if (CLR_CMAKE_TARGET_ARCH_AMD64)
4   if (CLR_CMAKE_PLATFORM_UNIX)
5     add_definitions(-DDBG_TARGET_AMD64_UNIX)
6   endif()
7   add_definitions(-D_TARGET_AMD64_=1)
8   add_definitions(-DDBG_TARGET_64BIT=1)
9   add_definitions(-DDBG_TARGET_AMD64=1)
10   add_definitions(-DDBG_TARGET_WIN64=1)
11 elseif (CLR_CMAKE_TARGET_ARCH_ARM64)
12   if (CLR_CMAKE_PLATFORM_UNIX)
13     add_definitions(-DDBG_TARGET_ARM64_UNIX)
14   endif()
15   add_definitions(-D_TARGET_ARM64_=1)
16   add_definitions(-DDBG_TARGET_64BIT=1)
17   add_definitions(-DDBG_TARGET_ARM64=1)
18   add_definitions(-DDBG_TARGET_WIN64=1)
19   add_definitions(-DFEATURE_MULTIREG_RETURN)
20 elseif (CLR_CMAKE_TARGET_ARCH_ARM)
21   if (CLR_CMAKE_PLATFORM_UNIX)
22     add_definitions(-DDBG_TARGET_ARM_UNIX)
23   elseif (WIN32 AND NOT DEFINED CLR_CROSS_COMPONENTS_BUILD)
24     # Set this to ensure we can use Arm SDK for Desktop binary linkage when doing native (Arm32) build
25     add_definitions(-D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1)
26     add_definitions(-D_ARM_WORKAROUND_)
27   endif (CLR_CMAKE_PLATFORM_UNIX)
28   add_definitions(-D_TARGET_ARM_=1)
29   add_definitions(-DDBG_TARGET_32BIT=1)
30   add_definitions(-DDBG_TARGET_ARM=1)
31 elseif (CLR_CMAKE_TARGET_ARCH_I386)
32   add_definitions(-D_TARGET_X86_=1)
33   add_definitions(-DDBG_TARGET_32BIT=1)
34   add_definitions(-DDBG_TARGET_X86=1)
35 else ()
36   clr_unknown_arch()
37 endif (CLR_CMAKE_TARGET_ARCH_AMD64)
38
39 if (CLR_CMAKE_PLATFORM_UNIX)
40
41   if(CLR_CMAKE_PLATFORM_DARWIN)
42     add_definitions(-D_XOPEN_SOURCE)
43     add_definitions(-DFEATURE_DATATARGET4)
44   endif(CLR_CMAKE_PLATFORM_DARWIN)
45
46   if (CLR_CMAKE_TARGET_ARCH_AMD64)
47     add_definitions(-DUNIX_AMD64_ABI)
48   elseif (CLR_CMAKE_TARGET_ARCH_ARM)
49     add_definitions(-DUNIX_ARM_ABI)
50   elseif (CLR_CMAKE_TARGET_ARCH_I386)
51     add_definitions(-DUNIX_X86_ABI)
52   endif()
53
54 endif(CLR_CMAKE_PLATFORM_UNIX)
55
56 if(CLR_CMAKE_PLATFORM_ALPINE_LINUX)
57   # Alpine Linux doesn't have fixed stack limit, this define disables some stack pointer
58   # sanity checks in debug / checked build that rely on a fixed stack limit
59   add_definitions(-DNO_FIXED_STACK_LIMIT)
60 endif(CLR_CMAKE_PLATFORM_ALPINE_LINUX)
61
62 add_definitions(-D_BLD_CLR)
63 add_definitions(-DDEBUGGING_SUPPORTED)
64 add_definitions(-DPROFILING_SUPPORTED)
65
66 if(WIN32)
67   add_definitions(-DWIN32)
68   add_definitions(-D_WIN32)
69   add_definitions(-DWINVER=0x0602)
70   add_definitions(-D_WIN32_WINNT=0x0602)
71   add_definitions(-DWIN32_LEAN_AND_MEAN=1)
72   add_definitions(-D_CRT_SECURE_NO_WARNINGS)
73   if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
74     # Only enable edit and continue on windows x86 and x64
75     # exclude Linux, arm & arm64
76     add_definitions(-DEnC_SUPPORTED)
77   endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
78 endif(WIN32)
79
80 # Features - please keep them alphabetically sorted
81 if (FEATURE_APPDOMAIN_RESOURCE_MONITORING)
82   add_definitions(-DFEATURE_APPDOMAIN_RESOURCE_MONITORING)
83 endif(FEATURE_APPDOMAIN_RESOURCE_MONITORING)
84
85 if(WIN32)
86   add_definitions(-DFEATURE_APPX)
87   if(NOT CLR_CMAKE_TARGET_ARCH_I386)
88     add_definitions(-DFEATURE_ARRAYSTUB_AS_IL)
89     add_definitions(-DFEATURE_MULTICASTSTUB_AS_IL)
90   endif()
91 else(WIN32)
92   add_definitions(-DFEATURE_ARRAYSTUB_AS_IL)
93   add_definitions(-DFEATURE_MULTICASTSTUB_AS_IL)
94 endif(WIN32)
95 add_definitions(-DFEATURE_CODE_VERSIONING)
96 add_definitions(-DFEATURE_COLLECTIBLE_TYPES)
97
98 if(WIN32)
99     add_definitions(-DFEATURE_CLASSIC_COMINTEROP)
100     add_definitions(-DFEATURE_COMINTEROP)
101     add_definitions(-DFEATURE_COMINTEROP_APARTMENT_SUPPORT)
102     add_definitions(-DFEATURE_COMINTEROP_UNMANAGED_ACTIVATION)
103     add_definitions(-DFEATURE_COMINTEROP_WINRT_MANAGED_ACTIVATION)
104 endif(WIN32)
105
106 add_definitions(-DFEATURE_CORECLR)
107 if (CLR_CMAKE_PLATFORM_UNIX)
108   add_definitions(-DFEATURE_COREFX_GLOBALIZATION)
109 endif(CLR_CMAKE_PLATFORM_UNIX)
110 add_definitions(-DFEATURE_CORESYSTEM)
111 add_definitions(-DFEATURE_CORRUPTING_EXCEPTIONS)
112 if(FEATURE_DBGIPC)
113   add_definitions(-DFEATURE_DBGIPC_TRANSPORT_DI)
114   add_definitions(-DFEATURE_DBGIPC_TRANSPORT_VM)
115 endif(FEATURE_DBGIPC)
116 if(FEATURE_EVENT_TRACE)
117     add_definitions(-DFEATURE_EVENT_TRACE=1)
118 endif(FEATURE_EVENT_TRACE)
119 if(FEATURE_GDBJIT)
120     add_definitions(-DFEATURE_GDBJIT)
121 endif()
122 if(FEATURE_GDBJIT_FRAME)
123     add_definitions(-DFEATURE_GDBJIT_FRAME)
124 endif(FEATURE_GDBJIT_FRAME)
125 if(CLR_CMAKE_PLATFORM_LINUX)
126     add_definitions(-DFEATURE_PERFTRACING)
127 endif(CLR_CMAKE_PLATFORM_LINUX)
128 if(CLR_CMAKE_PLATFORM_UNIX)
129     add_definitions(-DFEATURE_EVENTSOURCE_XPLAT=1)
130 endif(CLR_CMAKE_PLATFORM_UNIX)
131 # NetBSD doesn't implement this feature
132 if(NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
133     add_definitions(-DFEATURE_HIJACK)
134 endif(NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
135 add_definitions(-DFEATURE_ICASTABLE)
136 if (WIN32 AND (CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386))
137     add_definitions(-DFEATURE_INTEROP_DEBUGGING)
138 endif (WIN32 AND (CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386))
139 if (CLR_CMAKE_PLATFORM_UNIX OR CLR_CMAKE_TARGET_ARCH_ARM64)
140   add_definitions(-DFEATURE_IMPLICIT_TLS)
141   set(FEATURE_IMPLICIT_TLS 1)
142 endif(CLR_CMAKE_PLATFORM_UNIX OR CLR_CMAKE_TARGET_ARCH_ARM64)
143 if(FEATURE_INTERPRETER)
144   add_definitions(-DFEATURE_INTERPRETER)
145 endif(FEATURE_INTERPRETER)
146 add_definitions(-DFEATURE_ISYM_READER)
147 if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
148     add_definitions(-DFEATURE_JUMPSTAMP)
149   endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
150 add_definitions(-DFEATURE_LOADER_OPTIMIZATION)
151 if (CLR_CMAKE_PLATFORM_LINUX OR WIN32)
152     add_definitions(-DFEATURE_MANAGED_ETW)
153 endif(CLR_CMAKE_PLATFORM_LINUX OR WIN32)
154 add_definitions(-DFEATURE_MANAGED_ETW_CHANNELS)
155
156 if(FEATURE_MERGE_JIT_AND_ENGINE)
157   add_definitions(-DFEATURE_MERGE_JIT_AND_ENGINE)
158 endif(FEATURE_MERGE_JIT_AND_ENGINE)
159 add_definitions(-DFEATURE_MULTICOREJIT)
160 if (FEATURE_NI_BIND_FALLBACK)
161   add_definitions(-DFEATURE_NI_BIND_FALLBACK)
162 endif(FEATURE_NI_BIND_FALLBACK)
163 if(CLR_CMAKE_PLATFORM_UNIX)
164   add_definitions(-DFEATURE_PAL)
165   add_definitions(-DFEATURE_PAL_SXS)
166   add_definitions(-DFEATURE_PAL_ANSI)
167 endif(CLR_CMAKE_PLATFORM_UNIX)
168 if(CLR_CMAKE_PLATFORM_LINUX)
169     add_definitions(-DFEATURE_PERFMAP)
170 endif(CLR_CMAKE_PLATFORM_LINUX)
171 add_definitions(-DFEATURE_PREJIT)
172 add_definitions(-DFEATURE_RANDOMIZED_STRING_HASHING)
173
174 add_definitions(-DFEATURE_READYTORUN)
175 set(FEATURE_READYTORUN 1)
176
177 if (CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
178   add_definitions(-DFEATURE_REJIT)
179 endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
180
181 add_definitions(-DFEATURE_STANDALONE_SN)
182 add_definitions(-DFEATURE_STRONGNAME_DELAY_SIGNING_ALLOWED)
183 add_definitions(-DFEATURE_STRONGNAME_MIGRATION)
184 if (CLR_CMAKE_PLATFORM_UNIX OR CLR_CMAKE_TARGET_ARCH_ARM64)
185     add_definitions(-DFEATURE_STUBS_AS_IL)
186 endif ()
187 add_definitions(-DFEATURE_SVR_GC)
188 add_definitions(-DFEATURE_SYMDIFF)
189 add_definitions(-DFEATURE_TIERED_COMPILATION)
190 if (CLR_CMAKE_PLATFORM_ARCH_AMD64)
191   # Enable the AMD64 Unix struct passing JIT-EE interface for all AMD64 platforms, to enable altjit.
192   add_definitions(-DFEATURE_UNIX_AMD64_STRUCT_PASSING_ITF)
193 endif (CLR_CMAKE_PLATFORM_ARCH_AMD64)
194 if(CLR_CMAKE_PLATFORM_UNIX_AMD64)
195   add_definitions(-DFEATURE_MULTIREG_RETURN)
196   add_definitions(-DFEATURE_UNIX_AMD64_STRUCT_PASSING)
197 endif (CLR_CMAKE_PLATFORM_UNIX_AMD64)
198 add_definitions(-DFEATURE_USE_ASM_GC_WRITE_BARRIERS)
199 if((CLR_CMAKE_PLATFORM_ARCH_AMD64 OR CLR_CMAKE_PLATFORM_ARCH_ARM64) AND NOT WIN32)
200   add_definitions(-DFEATURE_MANUALLY_MANAGED_CARD_BUNDLES)
201   add_definitions(-DFEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP)
202 endif((CLR_CMAKE_PLATFORM_ARCH_AMD64 OR CLR_CMAKE_PLATFORM_ARCH_ARM64) AND NOT WIN32)
203 if(WIN32)
204     add_definitions(-DFEATURE_VERSIONING_LOG)
205 endif(WIN32)
206 if(NOT CLR_CMAKE_PLATFORM_UNIX)
207     add_definitions(-DFEATURE_WIN32_REGISTRY)
208 endif(NOT CLR_CMAKE_PLATFORM_UNIX)
209 add_definitions(-DFEATURE_LEGACYNETCF_DBG_HOST_CONTROL)
210 add_definitions(-DFEATURE_WINDOWSPHONE)
211 add_definitions(-DFEATURE_WINMD_RESILIENT)
212 add_definitions(-D_SECURE_SCL=0)
213 add_definitions(-DUNICODE)
214 add_definitions(-D_UNICODE)