Merge pull request #3484 from Dmitry-Me/fixBrokenCondition
[platform/upstream/coreclr.git] / clrdefinitions.cmake
1 if(WIN32 AND CLR_CMAKE_TARGET_ARCH_I386 AND BUILD_JIT32)  
2   set(CLR_BUILD_JIT32 1)  
3 else()  
4   set(CLR_BUILD_JIT32 0)  
5 endif()  
6
7 if (WIN32)
8   set(FEATURE_EVENT_TRACE 1)
9 endif()
10 if(CLR_CMAKE_PLATFORM_LINUX AND CLR_CMAKE_TARGET_ARCH_AMD64)
11   set(FEATURE_EVENT_TRACE 1)
12 endif()
13
14 if (CLR_CMAKE_TARGET_ARCH_AMD64)
15   if (CLR_CMAKE_PLATFORM_UNIX)
16     add_definitions(-DDBG_TARGET_AMD64_UNIX)
17   endif()
18   add_definitions(-D_TARGET_AMD64_=1)
19   add_definitions(-DDBG_TARGET_64BIT=1)
20   add_definitions(-DDBG_TARGET_AMD64=1)
21   add_definitions(-DDBG_TARGET_WIN64=1)
22 elseif (CLR_CMAKE_TARGET_ARCH_ARM64)
23   if (CLR_CMAKE_PLATFORM_UNIX)
24     add_definitions(-DDBG_TARGET_ARM64_UNIX)
25   endif()
26   add_definitions(-D_TARGET_ARM64_=1)
27   add_definitions(-DDBG_TARGET_64BIT=1)
28   add_definitions(-DDBG_TARGET_ARM64=1)
29   add_definitions(-DDBG_TARGET_WIN64=1)
30 elseif (CLR_CMAKE_TARGET_ARCH_ARM)
31   if (CLR_CMAKE_PLATFORM_UNIX)
32     add_definitions(-DDBG_TARGET_ARM_UNIX)
33   endif (CLR_CMAKE_PLATFORM_UNIX)
34   add_definitions(-D_TARGET_ARM_=1)
35   add_definitions(-DDBG_TARGET_32BIT=1)
36   add_definitions(-DDBG_TARGET_ARM=1)
37 elseif (CLR_CMAKE_TARGET_ARCH_I386)
38   add_definitions(-D_TARGET_X86_=1)
39   add_definitions(-DDBG_TARGET_32BIT=1)
40   add_definitions(-DDBG_TARGET_X86=1)
41 else ()
42   clr_unknown_arch()
43 endif (CLR_CMAKE_TARGET_ARCH_AMD64)
44
45 if (CLR_CMAKE_PLATFORM_UNIX)
46
47   if(CLR_CMAKE_PLATFORM_DARWIN)
48     add_definitions(-D_XOPEN_SOURCE)
49   endif(CLR_CMAKE_PLATFORM_DARWIN)
50
51   if (CLR_CMAKE_PLATFORM_UNIX_AMD64)
52     add_definitions(-DUNIX_AMD64_ABI)
53   elseif (CLR_CMAKE_PLATFORM_UNIX_ARM)
54     add_definitions(-DUNIX_ARM_ABI)
55   endif()
56
57 endif(CLR_CMAKE_PLATFORM_UNIX)
58
59 add_definitions(-D_BLD_CLR)
60 add_definitions(-DDEBUGGING_SUPPORTED)
61 add_definitions(-DPROFILING_SUPPORTED)
62
63 if(WIN32)
64   add_definitions(-DWIN32)
65   add_definitions(-D_WIN32)
66   add_definitions(-DWINVER=0x0602)
67   add_definitions(-D_WIN32_WINNT=0x0602)
68   add_definitions(-DWIN32_LEAN_AND_MEAN=1)
69   add_definitions(-D_CRT_SECURE_NO_WARNINGS)
70   if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
71     # Only enable edit and continue on windows x86 and x64
72     # exclude Linux, arm & arm64
73     add_definitions(-DEnC_SUPPORTED)
74   endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
75 endif(WIN32)
76
77 # Features - please keep them alphabetically sorted
78
79 add_definitions(-DFEATURE_APPDOMAIN_RESOURCE_MONITORING)
80 if(WIN32)
81     add_definitions(-DFEATURE_APPX)
82 endif(WIN32)
83 if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_ARM64)
84     add_definitions(-DFEATURE_ARRAYSTUB_AS_IL)
85 endif()
86
87 add_definitions(-DFEATURE_ASYNC_IO)
88 add_definitions(-DFEATURE_BCL_FORMATTING)
89 add_definitions(-DFEATURE_COLLECTIBLE_TYPES)
90
91 if(WIN32)
92     add_definitions(-DFEATURE_CLASSIC_COMINTEROP)
93     add_definitions(-DFEATURE_COMINTEROP)
94     add_definitions(-DFEATURE_COMINTEROP_APARTMENT_SUPPORT)
95     add_definitions(-DFEATURE_COMINTEROP_UNMANAGED_ACTIVATION)
96     add_definitions(-DFEATURE_COMINTEROP_WINRT_MANAGED_ACTIVATION)
97 endif(WIN32)
98
99 add_definitions(-DFEATURE_CORECLR)
100 if (CLR_CMAKE_PLATFORM_UNIX)
101   add_definitions(-DFEATURE_COREFX_GLOBALIZATION)
102 endif(CLR_CMAKE_PLATFORM_UNIX)
103 add_definitions(-DFEATURE_CORESYSTEM)
104 add_definitions(-DFEATURE_CORRUPTING_EXCEPTIONS)
105 if(CLR_CMAKE_PLATFORM_UNIX)
106     add_definitions(-DFEATURE_DBGIPC_TRANSPORT_DI)
107     add_definitions(-DFEATURE_DBGIPC_TRANSPORT_VM)
108 endif(CLR_CMAKE_PLATFORM_UNIX)
109 if(FEATURE_EVENT_TRACE)
110     add_definitions(-DFEATURE_EVENT_TRACE=1)
111 endif(FEATURE_EVENT_TRACE)
112 if(CLR_CMAKE_PLATFORM_UNIX)
113     add_definitions(-DFEATURE_EVENTSOURCE_XPLAT=1)
114 endif(CLR_CMAKE_PLATFORM_UNIX)
115 add_definitions(-DFEATURE_EXCEPTIONDISPATCHINFO)
116 # NetBSD doesn't implement this feature
117 if(NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
118     add_definitions(-DFEATURE_HIJACK)
119 endif(NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
120 add_definitions(-DFEATURE_HOST_ASSEMBLY_RESOLVER)
121 add_definitions(-DFEATURE_ICASTABLE)
122 if (CLR_CMAKE_PLATFORM_UNIX OR CLR_CMAKE_TARGET_ARCH_ARM64)
123   add_definitions(-DFEATURE_IMPLICIT_TLS)
124   set(FEATURE_IMPLICIT_TLS 1)
125 endif(CLR_CMAKE_PLATFORM_UNIX OR CLR_CMAKE_TARGET_ARCH_ARM64)
126 add_definitions(-DFEATURE_ISYM_READER)
127 add_definitions(-DFEATURE_LOADER_OPTIMIZATION)
128 if (NOT CLR_CMAKE_PLATFORM_UNIX)
129 add_definitions(-DFEATURE_MANAGED_ETW)
130 endif(NOT CLR_CMAKE_PLATFORM_UNIX)
131 add_definitions(-DFEATURE_MANAGED_ETW_CHANNELS)
132 add_definitions(-DFEATURE_MAIN_CLR_MODULE_USES_CORE_NAME)
133 add_definitions(-DFEATURE_MERGE_CULTURE_SUPPORT_AND_ENGINE)
134
135 if(CLR_CMAKE_TARGET_ARCH_ARM64)
136   # TODO_DJIT: Remove this as part of enabling cross-compiling standalone JIT binary.
137   if (NOT CLR_CMAKE_PLATFORM_UNIX)
138     set(FEATURE_MERGE_JIT_AND_ENGINE 1)
139   endif(NOT CLR_CMAKE_PLATFORM_UNIX)
140 endif(CLR_CMAKE_TARGET_ARCH_ARM64)
141
142 if(FEATURE_MERGE_JIT_AND_ENGINE)
143   # Disable the following for UNIX altjit on Windows
144   add_definitions(-DFEATURE_MERGE_JIT_AND_ENGINE)
145 endif(FEATURE_MERGE_JIT_AND_ENGINE)
146 add_definitions(-DFEATURE_MULTICOREJIT)
147 add_definitions(-DFEATURE_NORM_IDNA_ONLY)
148 if(CLR_CMAKE_PLATFORM_UNIX)
149   add_definitions(-DFEATURE_PAL)
150   add_definitions(-DFEATURE_PAL_SXS)
151   add_definitions(-DFEATURE_PAL_ANSI)
152 endif(CLR_CMAKE_PLATFORM_UNIX)
153 if(CLR_CMAKE_PLATFORM_LINUX)
154     add_definitions(-DFEATURE_PERFMAP)
155 endif(CLR_CMAKE_PLATFORM_LINUX)
156 add_definitions(-DFEATURE_PREJIT)
157 add_definitions(-DFEATURE_RANDOMIZED_STRING_HASHING)
158
159 add_definitions(-DFEATURE_READYTORUN)
160 set(FEATURE_READYTORUN 1)
161
162 if (CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
163   add_definitions(-DFEATURE_REJIT)
164 endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
165
166 add_definitions(-DFEATURE_STANDALONE_SN)
167 add_definitions(-DFEATURE_STRONGNAME_DELAY_SIGNING_ALLOWED)
168 add_definitions(-DFEATURE_STRONGNAME_MIGRATION)
169 if ((CLR_CMAKE_PLATFORM_UNIX OR CLR_CMAKE_TARGET_ARCH_ARM64) AND NOT CLR_CMAKE_TARGET_ARCH_ARM)
170     add_definitions(-DFEATURE_STUBS_AS_IL)
171 endif ()
172 add_definitions(-DFEATURE_SVR_GC)
173 add_definitions(-DFEATURE_SYMDIFF)
174 add_definitions(-DFEATURE_SYNTHETIC_CULTURES)
175 if(CLR_CMAKE_PLATFORM_UNIX_AMD64)
176   add_definitions(-DFEATURE_UNIX_AMD64_STRUCT_PASSING)
177   add_definitions(-DFEATURE_UNIX_AMD64_STRUCT_PASSING_ITF)
178 endif (CLR_CMAKE_PLATFORM_UNIX_AMD64)
179 add_definitions(-DFEATURE_USE_ASM_GC_WRITE_BARRIERS)
180 if(CLR_CMAKE_PLATFORM_ARCH_AMD64 AND NOT WIN32)
181   add_definitions(-DFEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP)
182 endif(CLR_CMAKE_PLATFORM_ARCH_AMD64 AND NOT WIN32)
183 add_definitions(-DFEATURE_VERSIONING)
184 if(WIN32)
185     add_definitions(-DFEATURE_VERSIONING_LOG)
186 endif(WIN32)
187 if(NOT CLR_CMAKE_PLATFORM_UNIX)
188     add_definitions(-DFEATURE_WIN32_REGISTRY)
189 endif(NOT CLR_CMAKE_PLATFORM_UNIX)
190 add_definitions(-DFEATURE_WINDOWSPHONE)
191 add_definitions(-DFEATURE_WINMD_RESILIENT)
192 add_definitions(-D_SECURE_SCL=0)
193 add_definitions(-DUNICODE)
194 add_definitions(-D_UNICODE)