blob: 297e34c2d1127d7fe5432fc625913cbd7d218fb4 [file] [log] [blame]
Alexis Hetu7b4fc282019-05-17 14:25:04 -04001cmake_minimum_required(VERSION 2.8)
Corentin Wallez0866b292015-12-09 13:49:40 -05002
Corentin Wallezcd0a4572015-12-10 15:59:28 -05003project(SwiftShader C CXX)
Corentin Wallez0866b292015-12-09 13:49:40 -05004
Nicolas Capens4c9f04b2019-01-31 22:09:03 -05005# On Windows we use custom solution and project files, except for certain third-
6# party projects which use CMake-generated ones. They are manually (re)generated
7# and made path relative using build/cmake.sh, so they can be checked into the
8# repository. Therefore they should not be auto-regenerated and left using
9# absolute paths by CMake's ZERO_CHECK.
10if(WIN32)
11 # Disable automatically regenerating project files on CMakeLists.txt changes.
12 set(CMAKE_SUPPRESS_REGENERATION true)
13endif()
14
Corentin Wallez0866b292015-12-09 13:49:40 -050015###########################################################
16# Detect system
17###########################################################
18
Nicolas Capens6f422092015-12-23 15:12:45 -050019if(CMAKE_SYSTEM_NAME MATCHES "Linux")
Corentin Wallez0866b292015-12-09 13:49:40 -050020 set(LINUX ON)
Stephen Whitee6ab01f2019-04-04 14:31:25 -040021elseif(CMAKE_SYSTEM_NAME MATCHES "Android")
22 set(ANDROID ON)
23 set(CMAKE_CXX_FLAGS "-DANDROID_NDK_BUILD")
Corentin Wallez0866b292015-12-09 13:49:40 -050024elseif(WIN32)
25elseif(APPLE)
26else()
27 message(FATAL_ERROR "Platform is not supported")
28endif()
29
Nicolas Capens30cd7d42017-04-25 15:17:25 -040030if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm" OR CMAKE_SYSTEM_PROCESSOR MATCHES "aarch")
31 if(CMAKE_SIZEOF_VOID_P EQUAL 8)
32 set(ARCH "aarch64")
33 else()
34 set(ARCH "arm")
35 endif()
Gordana Cmiljanovic082dfec2018-10-19 11:36:15 +020036elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "mips*")
37 if(CMAKE_SIZEOF_VOID_P EQUAL 8)
38 set(ARCH "mips64el")
39 else()
40 set(ARCH "mipsel")
41 endif()
Colin Samplesf63a3ab2019-06-13 12:53:09 -040042elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc*")
43 if(CMAKE_SIZEOF_VOID_P EQUAL 8)
44 set(ARCH "ppc64le")
45 else()
46 message(FATAL_ERROR "Architecture is not supported")
47 endif()
Corentin Wallez0866b292015-12-09 13:49:40 -050048else()
Nicolas Capens30cd7d42017-04-25 15:17:25 -040049 if(CMAKE_SIZEOF_VOID_P EQUAL 8)
50 set(ARCH "x86_64")
51 else()
52 set(ARCH "x86")
53 endif()
Corentin Wallez0866b292015-12-09 13:49:40 -050054endif()
55
Nicolas Capens007c6c52017-06-09 11:21:48 -040056set(CMAKE_MACOSX_RPATH ON)
57
Nicolas Capensd7a21cc2018-09-11 13:09:28 -040058if ((CMAKE_GENERATOR MATCHES "Visual Studio") AND (CMAKE_GENERATOR_TOOLSET STREQUAL ""))
59 message(WARNING "Visual Studio generators use the x86 host compiler by "
60 "default, even for 64-bit targets. This can result in linker "
61 "instability and out of memory errors. To use the 64-bit "
62 "host compiler, pass -Thost=x64 on the CMake command line.")
63endif()
64
Ben Clayton4901ffd2019-06-27 10:39:07 +010065# Use CCache if available
66find_program(CCACHE_FOUND ccache)
67if(CCACHE_FOUND)
68 message(STATUS "Using ccache")
69 set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
70 set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
71endif(CCACHE_FOUND)
72
Corentin Wallez0866b292015-12-09 13:49:40 -050073###########################################################
Nicolas Capens18b8d682017-07-25 15:31:45 -040074# Options
75###########################################################
76
77if(NOT CMAKE_BUILD_TYPE)
78 set(CMAKE_BUILD_TYPE "Release" CACHE STRING "The type of build: Debug Release MinSizeRel RelWithDebInfo." FORCE)
79endif()
80set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release MinSizeRel RelWithDebInfo)
81
82option(BUILD_EGL "Build the EGL library" 1)
Nicolas Capens18b8d682017-07-25 15:31:45 -040083option(BUILD_GLESv2 "Build the OpenGL ES 2 library" 1)
84option(BUILD_GLES_CM "Build the OpenGL ES 1.1 library" 1)
Chris Forbes3d27f2e2018-09-26 09:24:39 -070085option(BUILD_VULKAN "Build the Vulkan library" 1)
Nicolas Capens18b8d682017-07-25 15:31:45 -040086
87option(USE_GROUP_SOURCES "Group the source files in a folder tree for Visual Studio" 1)
88
89option(BUILD_SAMPLES "Build sample programs" 1)
90option(BUILD_TESTS "Build test programs" 1)
91
Antonio Maioranof448d8e2019-04-26 16:19:16 -040092option(MSAN "Build with memory sanitizer" 0)
93option(ASAN "Build with address sanitizer" 0)
94option(TSAN "Build with thread sanitizer" 0)
95option(UBSAN "Build with undefined behavior sanitizer" 0)
Ben Claytonb51a6f02019-07-05 15:32:19 +010096option(WARNINGS_AS_ERRORS "Treat all warnings as errors" 1)
Antonio Maioranof448d8e2019-04-26 16:19:16 -040097option(DCHECK_ALWAYS_ON "Check validation macros even in release builds" 0)
98option(REACTOR_EMIT_DEBUG_INFO "Emit debug info for JIT functions" 0)
99option(REACTOR_EMIT_PRINT_LOCATION "Emit printing of location info for JIT functions" 0)
Ben Clayton5375f472019-06-24 13:33:11 +0100100option(REACTOR_VERIFY_LLVM_IR "Check reactor-generated LLVM IR is valid even in release builds" 0)
Nicolas Capensbf8fd5b2018-06-21 00:42:00 -0400101
Nicolas Capens18b8d682017-07-25 15:31:45 -0400102if(ARCH STREQUAL "arm")
103 set(DEFAULT_REACTOR_BACKEND "Subzero")
104else()
105 set(DEFAULT_REACTOR_BACKEND "LLVM")
106endif()
107
Nicolas Capens3957b7f2018-10-15 12:54:41 -0400108set(REACTOR_BACKEND ${DEFAULT_REACTOR_BACKEND} CACHE STRING "JIT compiler back-end used by Reactor")
Nicolas Capens18b8d682017-07-25 15:31:45 -0400109set_property(CACHE REACTOR_BACKEND PROPERTY STRINGS LLVM Subzero)
110
111# LLVM disallows calling cmake . from the main LLVM dir, the reason is that
112# it builds header files that could overwrite the orignal ones. Here we
113# want to include LLVM as a subdirectory and even though it wouldn't cause
114# the problem, if cmake . is called from the main dir, the condition that
Erwin Jansend46faeb2018-11-19 16:01:37 -0800115# LLVM checkes, "CMAKE_CURRENT_SOURCE_DIR == CMAKE_CURRENT_BINARY_DIR" will be true. So we
Nicolas Capens18b8d682017-07-25 15:31:45 -0400116# disallow it ourselves too to. In addition if there are remining CMakeFiles
117# and CMakeCache in the directory, cmake .. from a subdirectory will still
118# try to build from the main directory so we instruct users to delete these
119# files when they get the error.
Erwin Jansend46faeb2018-11-19 16:01:37 -0800120if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
Nicolas Capens18b8d682017-07-25 15:31:45 -0400121 message(FATAL_ERROR "In source builds are not allowed by LLVM, please create a build/ directory and build from there. You may have to delete the CMakeCache.txt file and CMakeFiles directory that are next to the CMakeLists.txt.")
122endif()
123
124set_property(GLOBAL PROPERTY USE_FOLDERS ON)
125
126###########################################################
Nicolas Capensfe5861b2018-08-03 16:01:48 -0400127# Initialize submodules
128###########################################################
129
Dan Sinclair6480d4e2019-03-11 10:48:19 -0400130if (NOT TARGET gtest)
131 if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/.git)
132 message(WARNING "
133 third_party/googletest submodule missing.
134 Running 'git submodule update --init' to download it:
135 ")
Nicolas Capensfe5861b2018-08-03 16:01:48 -0400136
Dan Sinclair6480d4e2019-03-11 10:48:19 -0400137 execute_process(COMMAND git submodule update --init)
138 endif()
Nicolas Capensfe5861b2018-08-03 16:01:48 -0400139endif()
140
Ben Clayton755467c2019-03-23 11:57:02 +0000141if (NOT TARGET libbacktrace)
142 if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libbacktrace/src/.git)
143 message(WARNING "
144 third_party/libbacktrace/src submodule missing.
145 Running 'git submodule update --init' to download it:
146 ")
147
148 execute_process(COMMAND git submodule update --init)
149 endif()
150endif()
151
Antonio Maiorano8b321d12019-05-27 16:15:34 -0400152# Boost is downloaded if necessary
153
154# From https://www.boost.org/users/download/
155set(BOOST_VER 1.70.0)
156set(BOOST_HASH_TARGZ "882b48708d211a5f48e60b0124cf5863c1534cd544ecd0664bb534a4b5d506e9")
157set(BOOST_HASH_ZIP "48f379b2e90dd1084429aae87d6bdbde9670139fa7569ee856c8c86dd366039d")
158
159string(REPLACE "." "_" BOOST_VER_FNAME ${BOOST_VER})
160set(BOOST_THIRD_PARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/boost_${BOOST_VER_FNAME})
161
162function(DownloadBoost)
163 if (LINUX)
164 set(BOOST_EXT "tar.gz")
165 set(BOOST_HASH ${BOOST_HASH_TARGZ})
166 else()
167 set(BOOST_EXT "zip")
168 set(BOOST_HASH ${BOOST_HASH_ZIP})
169 endif()
170
171 # Note: bintray.com has rate limiting, so use the sourceforge mirror
172 # set(BOOST_URL https://dl.bintray.com/boostorg/release/${BOOST_VER}/source/boost_${BOOST_VER_FNAME}.${BOOST_EXT})
173 set(BOOST_URL https://iweb.dl.sourceforge.net/project/boost/boost/${BOOST_VER}/boost_${BOOST_VER_FNAME}.${BOOST_EXT})
174
175 if (NOT TARGET Boost::boost)
176 if(NOT EXISTS ${BOOST_THIRD_PARTY_DIR})
177 message(WARNING "
178 third_party/boost is missing.
179 Downloading and extracting boost:
180 ")
181
182 set(BOOST_ARCHIVE ${CMAKE_BINARY_DIR}/temp/boost_archive)
183 message(STATUS "Downloading ${BOOST_URL} to ${BOOST_ARCHIVE}...")
184 file(DOWNLOAD ${BOOST_URL} ${BOOST_ARCHIVE} EXPECTED_HASH SHA256=${BOOST_HASH})
185 message(STATUS "Extracting ${BOOST_ARCHIVE} to ${BOOST_THIRD_PARTY_DIR}...")
186 execute_process(
187 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/third_party
188 COMMAND cmake -E tar xf ${BOOST_ARCHIVE}
189 )
190 endif()
191 endif()
192endfunction()
193
Nicolas Capensfe5861b2018-08-03 16:01:48 -0400194###########################################################
Corentin Wallez0866b292015-12-09 13:49:40 -0500195# Convenience macros
196###########################################################
197
198# Recursively calls source_group on the files of the directory
199# so that Visual Studio has the files in a folder tree
200macro(group_all_sources directory)
Erwin Jansend46faeb2018-11-19 16:01:37 -0800201 file(GLOB files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/${directory} ${CMAKE_CURRENT_SOURCE_DIR}/${directory}/*)
Corentin Wallez0866b292015-12-09 13:49:40 -0500202 foreach(file ${files})
Erwin Jansend46faeb2018-11-19 16:01:37 -0800203 if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${directory}/${file})
Corentin Wallez0866b292015-12-09 13:49:40 -0500204 group_all_sources(${directory}/${file})
205 else()
206 string(REPLACE "/" "\\" groupname ${directory})
Erwin Jansend46faeb2018-11-19 16:01:37 -0800207 source_group(${groupname} FILES ${CMAKE_CURRENT_SOURCE_DIR}/${directory}/${file})
Corentin Wallez0866b292015-12-09 13:49:40 -0500208 endif()
209 endforeach()
210endmacro()
211
212# Takes target library and a directory where the export map is
213# and add the linker options so that only the API symbols are
214# exported.
Nicolas Capens499bb762018-06-29 13:30:57 -0400215macro(set_shared_library_export_map TARGET DIR)
Corentin Wallez0866b292015-12-09 13:49:40 -0500216 if(MSVC)
Nicolas Capens499bb762018-06-29 13:30:57 -0400217 set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " /DEF:\"${DIR}/${TARGET}.def\"")
Ben Clayton8565e772019-06-10 11:58:37 +0100218 elseif(APPLE)
219 # The exported symbols list only exports the API functions and
220 # hides all the others.
221 set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS "-exported_symbols_list ${DIR}/${TARGET}.exports")
222 set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_DEPENDS "${DIR}/${TARGET}.exports;")
223 # Don't allow undefined symbols, unless it's a Sanitizer build.
224 if(NOT MSAN AND NOT ASAN AND NOT TSAN AND NOT UBSAN)
225 set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-undefined,error")
226 endif()
Corentin Wallez27654c22015-12-09 15:22:08 -0500227 elseif(LINUX)
Corentin Wallez0866b292015-12-09 13:49:40 -0500228 # The version script only exports the API functions and
Nicolas Capens499bb762018-06-29 13:30:57 -0400229 # hides all the others.
230 set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--version-script=${DIR}/${TARGET}.lds")
231 set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_DEPENDS "${DIR}/${TARGET}.lds;")
Nicolas Capensbf8fd5b2018-06-21 00:42:00 -0400232
Nicolas Capens517a57f2018-06-29 13:30:57 -0400233 # Don't allow symbols to be overridden by another module.
234 set_property(TARGET ${TARGET} APPEND_STRING PROPERTY COMPILE_FLAGS " -fvisibility=protected")
235
Gordana Cmiljanovic20622c02018-11-05 15:00:11 +0100236 if(ARCH STREQUAL "mipsel" OR ARCH STREQUAL "mips64el")
Gordana Cmiljanovic082dfec2018-10-19 11:36:15 +0200237 # MIPS supports sysv hash-style only.
238 set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--hash-style=sysv")
239 else()
240 # Both hash-style are needed, because we want both gold and
241 # GNU ld to be able to read our libraries.
242 set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--hash-style=both")
243 endif()
Nicolas Capens499bb762018-06-29 13:30:57 -0400244
245 # Gc sections is used in combination with each functions being
246 # in its own section, to reduce the binary size.
247 set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--gc-sections")
248
249 # Don't allow undefined symbols, unless it's a Sanitizer build.
Nicolas Capensbf8fd5b2018-06-21 00:42:00 -0400250 if(NOT MSAN AND NOT ASAN AND NOT TSAN AND NOT UBSAN)
251 set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--no-undefined")
252 endif()
Corentin Wallez0866b292015-12-09 13:49:40 -0500253 endif()
254endmacro()
255
256if(USE_GROUP_SOURCES)
257 group_all_sources(src)
258endif()
259
260###########################################################
261# Directories
262###########################################################
263
Erwin Jansend46faeb2018-11-19 16:01:37 -0800264set(SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
Corentin Wallez0866b292015-12-09 13:49:40 -0500265set(OPENGL_DIR ${SOURCE_DIR}/OpenGL)
266set(OPENGL_COMPILER_DIR ${OPENGL_DIR}/compiler)
Chris Forbes3d27f2e2018-09-26 09:24:39 -0700267set(VULKAN_DIR ${SOURCE_DIR}/Vulkan)
Ben Clayton5875be52019-04-11 14:57:40 -0400268set(LLVM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/llvm-7.0/llvm)
269set(LLVM_CONFIG_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/llvm-7.0/configs)
Ben Claytonac07ed82019-03-26 14:17:41 +0000270set(LIBBACKTRACE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libbacktrace/src)
271set(LIBBACKTRACE_CONFIG_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libbacktrace/config)
272set(LIBBACKTRACE_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libbacktrace/src)
Erwin Jansend46faeb2018-11-19 16:01:37 -0800273set(SUBZERO_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/subzero)
274set(SUBZERO_LLVM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/llvm-subzero)
275set(TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tests)
276set(HELLO2_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/PowerVR_SDK/Examples/Beginner/01_HelloAPI/OGLES2)
Corentin Wallez0866b292015-12-09 13:49:40 -0500277
278###########################################################
279# Compile flags
280###########################################################
281
Ben Clayton4ceb77d2019-04-24 12:09:59 +0100282# Flags for project code (non 3rd party)
283set(SWIFTSHADER_COMPILE_OPTIONS "")
284
Nicolas Capens6f422092015-12-23 15:12:45 -0500285macro(set_cpp_flag FLAG)
286 if(${ARGC} GREATER 1)
287 set(CMAKE_CXX_FLAGS_${ARGV1} "${CMAKE_CXX_FLAGS_${ARGV1}} ${FLAG}")
Corentin Wallez0866b292015-12-09 13:49:40 -0500288 else()
Nicolas Capens6f422092015-12-23 15:12:45 -0500289 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAG}")
Corentin Wallez0866b292015-12-09 13:49:40 -0500290 endif()
291endmacro()
292
Ben Clayton48c8a182019-05-21 20:00:20 +0100293macro(set_linker_flag FLAG)
294 if(${ARGC} GREATER 1)
295 set(CMAKE_EXE_LINKER_FLAGS ${ARGV1} "${CMAKE_EXE_LINKER_FLAGS ${ARGV1}} ${FLAG}")
296 else()
297 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FLAG}")
298 endif()
299endmacro()
300
Corentin Wallez0866b292015-12-09 13:49:40 -0500301if(MSVC)
302 set_cpp_flag("/MP")
303 add_definitions(-D_CRT_SECURE_NO_WARNINGS)
Antonio Maiorano5bce1f42019-05-10 16:03:49 -0400304 add_definitions(-D_SCL_SECURE_NO_WARNINGS)
Nicolas Capens4c9f04b2019-01-31 22:09:03 -0500305 add_definitions(-D_SBCS) # Single Byte Character Set (ASCII)
Antonio Maiorano5bce1f42019-05-10 16:03:49 -0400306
307 if(WARNINGS_AS_ERRORS)
308 set_cpp_flag("/WX") # Treat all warnings as errors
309 endif()
310
311 # Disable specific warnings
312 # TODO: Not all of these should be disabled, but for now, we want a warning-free msvc build. Remove these one by one
313 # and fix the actual warnings in code.
314 list(APPEND SWIFTSHADER_COMPILE_OPTIONS
315 "/wd4005" # 'identifier' : macro redefinition
316 "/wd4018" # 'expression' : signed/unsigned mismatch
Ben Clayton4d4a1902019-05-15 11:15:42 +0100317 "/wd4065" # switch statement contains 'default' but no 'case' labels
Antonio Maiorano5bce1f42019-05-10 16:03:49 -0400318 "/wd4141" # 'modifier' : used more than once
319 "/wd4146" # unary minus operator applied to unsigned type, result still unsigned
320 "/wd4244" # 'conversion' conversion from 'type1' to 'type2', possible loss of data
321 "/wd4267" # 'var' : conversion from 'size_t' to 'type', possible loss of data
322 "/wd4291" # 'void X new(size_t,unsigned int,unsigned int)': no matching operator delete found; memory will not be freed if initialization throws an exception
323 "/wd4309" # 'conversion' : truncation of constant value
324 "/wd4624" # 'derived class' : destructor was implicitly defined as deleted because a base class destructor is inaccessible or deleted
325 "/wd4800" # 'type' : forcing value to bool 'true' or 'false' (performance warning)
326 "/wd4838" # conversion from 'type_1' to 'type_2' requires a narrowing conversion
327 "/wd5030" # attribute 'attribute' is not recognized
328 "/wd5038" # data member 'member1' will be initialized after data member 'member2' data member 'member' will be initialized after base class 'base_class'
329 )
330
331 # Treat specific warnings as errors
332 list(APPEND SWIFTSHADER_COMPILE_OPTIONS
333 "/we4018" # 'expression' : signed/unsigned mismatch
Antonio Maiorano23da0732019-05-14 22:32:16 -0400334 "/we4471" # 'enumeration': a forward declaration of an unscoped enumeration must have an underlying type (int assumed)
Antonio Maiorano5bce1f42019-05-10 16:03:49 -0400335 "/we4838" # conversion from 'type_1' to 'type_2' requires a narrowing conversion
336 "/we5038" # data member 'member1' will be initialized after data member 'member2' data member 'member' will be initialized after base class 'base_class'
337 )
338
Corentin Wallez0866b292015-12-09 13:49:40 -0500339else()
Chris Forbesef4ab0f2019-01-18 08:11:03 -0800340 set_cpp_flag("--std=c++11")
Ben Clayton09a7f452019-04-25 15:22:43 +0100341 set_cpp_flag("-fno-exceptions")
342
Ben Clayton4ceb77d2019-04-24 12:09:59 +0100343 list(APPEND SWIFTSHADER_COMPILE_OPTIONS
Ben Clayton4ceb77d2019-04-24 12:09:59 +0100344 "-Wall"
Ben Clayton8a983f72019-06-18 17:56:36 +0100345 "-Wreorder"
346 "-Wsign-compare"
347 "-Wmissing-braces"
Ben Clayton4ceb77d2019-04-24 12:09:59 +0100348 )
Corentin Wallez0866b292015-12-09 13:49:40 -0500349
Ben Clayton5e828762019-04-24 19:16:52 +0100350 if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Ben Clayton4ceb77d2019-04-24 12:09:59 +0100351 list(APPEND SWIFTSHADER_COMPILE_OPTIONS
Ben Clayton8a983f72019-06-18 17:56:36 +0100352 "-Wunused-lambda-capture"
353 "-Wstring-conversion"
354 "-Wextra-semi"
355 "-Wignored-qualifiers"
Nicolas Capens67180a02019-06-17 15:27:03 -0400356 # Silence errors caused by unknown warnings when building with older
357 # versions of Clang. This demands checking that warnings added above
358 # are spelled correctly and work as intended!
359 "-Wno-unknown-warning-option"
Ben Clayton4ceb77d2019-04-24 12:09:59 +0100360 )
Nicolas Capens825d3442018-11-06 23:50:05 -0500361 endif()
362
Corentin Wallez0866b292015-12-09 13:49:40 -0500363 # Remove xor, and, or and friends from the list of keywords, they are used
364 # by Reactor
Ben Clayton4ceb77d2019-04-24 12:09:59 +0100365 list(APPEND SWIFTSHADER_COMPILE_OPTIONS
366 "-fno-operator-names"
367 )
Corentin Wallez0866b292015-12-09 13:49:40 -0500368
369 # LLVM headers requires these flags to be set
370 set_cpp_flag("-D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS")
371
Nicolas Capens499bb762018-06-29 13:30:57 -0400372 if(ARCH STREQUAL "x86")
Corentin Wallez0866b292015-12-09 13:49:40 -0500373 set_cpp_flag("-m32")
374 set_cpp_flag("-msse2")
Nicolas Capens0424edc2018-01-03 14:06:30 -0500375 set_cpp_flag("-mfpmath=sse")
376 set_cpp_flag("-march=pentium4")
377 set_cpp_flag("-mtune=generic")
Corentin Wallez0866b292015-12-09 13:49:40 -0500378 endif()
Nicolas Capens499bb762018-06-29 13:30:57 -0400379 if(ARCH STREQUAL "x86_64")
Corentin Wallez0866b292015-12-09 13:49:40 -0500380 set_cpp_flag("-m64")
381 set_cpp_flag("-fPIC")
Nicolas Capens0424edc2018-01-03 14:06:30 -0500382 set_cpp_flag("-march=x86-64")
383 set_cpp_flag("-mtune=generic")
Corentin Wallez0866b292015-12-09 13:49:40 -0500384 endif()
Gordana Cmiljanovic082dfec2018-10-19 11:36:15 +0200385 if(ARCH STREQUAL "mipsel")
386 set_cpp_flag("-march=mips32r2")
387 set_cpp_flag("-fPIC")
388 set_cpp_flag("-mhard-float")
389 set_cpp_flag("-mfp32")
390 endif()
Gordana Cmiljanovic20622c02018-11-05 15:00:11 +0100391 if(ARCH STREQUAL "mips64el")
392 set_cpp_flag("-march=mips64r2")
393 set_cpp_flag("-mabi=64")
394 set_cpp_flag("-fPIC")
395 endif()
Nicolas Capens499bb762018-06-29 13:30:57 -0400396
Alexis Hetu0662a4a2019-07-08 15:06:40 -0400397 if(WIN32)
398 set_cpp_flag("-DVK_USE_PLATFORM_WIN32_KHR")
399 elseif(LINUX)
Alexis Hetu20eea3c2018-06-19 14:50:41 -0400400 set_cpp_flag("-DUSE_X11=1")
Hernan Liatis2bb08642019-02-08 14:08:21 -0800401 set_cpp_flag("-DVK_USE_PLATFORM_XLIB_KHR")
Alexis Hetu0662a4a2019-07-08 15:06:40 -0400402 elseif(APPLE)
403 set_cpp_flag("-DVK_USE_PLATFORM_MACOS_MVK")
Alexis Hetu20eea3c2018-06-19 14:50:41 -0400404 endif()
Corentin Wallez0866b292015-12-09 13:49:40 -0500405
406 # Use -g3 to have even more debug info
407 set_cpp_flag("-g -g3" DEBUG)
408 set_cpp_flag("-g -g3" RELWITHDEBINFO)
Ben Clayton09a91e42019-02-05 17:58:38 +0000409 if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
410 # Treated as an unused argument with clang
411 set_cpp_flag("-s" RELEASE)
412 endif()
Corentin Wallez0866b292015-12-09 13:49:40 -0500413
Ben Clayton7aafb272019-02-19 17:08:56 +0000414 if(WARNINGS_AS_ERRORS)
415 set_cpp_flag("-Werror") # Treat all warnings as errors
416 endif()
417
Ben Claytonf1172912019-02-26 16:52:12 +0000418 if(DCHECK_ALWAYS_ON)
Ben Clayton4ceb77d2019-04-24 12:09:59 +0100419 list(APPEND SWIFTSHADER_COMPILE_OPTIONS "-DDCHECK_ALWAYS_ON")
Ben Claytonf1172912019-02-26 16:52:12 +0000420 endif()
421
Ben Clayton0eee3322019-02-19 17:08:14 +0000422 # Disable pedanitc warnings
423 if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
Ben Clayton4ceb77d2019-04-24 12:09:59 +0100424 list(APPEND SWIFTSHADER_COMPILE_OPTIONS
425 "-Wno-ignored-attributes" # ignoring attributes on template argument 'X'
426 "-Wno-attributes" # 'X' attribute ignored
427 "-Wno-strict-aliasing" # dereferencing type-punned pointer will break strict-aliasing rules
428 "-Wno-comment" # multi-line comment
429 )
Ben Clayton0eee3322019-02-19 17:08:14 +0000430 elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Ben Clayton4ceb77d2019-04-24 12:09:59 +0100431 list(APPEND SWIFTSHADER_COMPILE_OPTIONS
432 "-Wno-unneeded-internal-declaration" # function 'X' is not needed and will not be emitted
433 "-Wno-unused-private-field" # private field 'offset' is not used - TODO: Consider enabling this once Vulkan is further implemented.
434 "-Wno-comment" # multi-line comment
435 "-Wno-undefined-var-template" # instantiation of variable 'X' required here, but no definition is available
436 )
Ben Clayton0eee3322019-02-19 17:08:14 +0000437 endif()
438
Corentin Wallez0866b292015-12-09 13:49:40 -0500439 # For distribution it is more important to be slim than super optimized
Alexis Hetu2c0546d2017-05-24 11:16:26 -0400440 set_cpp_flag("-Os" RELEASE)
441 set_cpp_flag("-Os" RELWITHDEBINFO)
Corentin Wallez0866b292015-12-09 13:49:40 -0500442
443 set_cpp_flag("-DNDEBUG" RELEASE)
444 set_cpp_flag("-DNDEBUG" RELWITHDEBINFO)
445 set_cpp_flag("-DANGLE_DISABLE_TRACE" RELEASE)
446 set_cpp_flag("-DANGLE_DISABLE_TRACE" RELWITHDEBINFO)
447
448 # Put each variable and function in its own section so that when linking
449 # with -gc-sections unused functions and variables are removed.
450 set_cpp_flag("-ffunction-sections" RELEASE)
451 set_cpp_flag("-fdata-sections" RELEASE)
452 set_cpp_flag("-fomit-frame-pointer" RELEASE)
Nicolas Capensbf8fd5b2018-06-21 00:42:00 -0400453
Ben Claytondae97922019-05-17 12:09:31 +0100454 if(MSAN)
455 set_cpp_flag("-fsanitize=memory")
Ben Clayton48c8a182019-05-21 20:00:20 +0100456 set_linker_flag("-fsanitize=memory")
Ben Claytondae97922019-05-17 12:09:31 +0100457 elseif(ASAN)
458 set_cpp_flag("-fsanitize=address")
Ben Clayton48c8a182019-05-21 20:00:20 +0100459 set_linker_flag("-fsanitize=address")
Ben Claytondae97922019-05-17 12:09:31 +0100460 elseif(TSAN)
461 set_cpp_flag("-fsanitize=thread")
Ben Clayton48c8a182019-05-21 20:00:20 +0100462 set_linker_flag("-fsanitize=thread")
Ben Claytondae97922019-05-17 12:09:31 +0100463 elseif(UBSAN)
464 set_cpp_flag("-fsanitize=undefined")
Ben Clayton48c8a182019-05-21 20:00:20 +0100465 set_linker_flag("-fsanitize=undefined")
Nicolas Capensbf8fd5b2018-06-21 00:42:00 -0400466 endif()
Corentin Wallez0866b292015-12-09 13:49:40 -0500467endif()
468
Antonio Maioranof448d8e2019-04-26 16:19:16 -0400469if(REACTOR_EMIT_PRINT_LOCATION)
470 # This feature depends on REACTOR_EMIT_DEBUG_INFO, so enable it
471 set(REACTOR_EMIT_DEBUG_INFO "On")
472 list(APPEND SWIFTSHADER_COMPILE_OPTIONS "-DENABLE_RR_EMIT_PRINT_LOCATION")
473endif()
474
475if(REACTOR_EMIT_DEBUG_INFO)
476 message(WARNING "REACTOR_EMIT_DEBUG_INFO is enabled. This will likely affect performance.")
477 list(APPEND SWIFTSHADER_COMPILE_OPTIONS "-DENABLE_RR_DEBUG_INFO")
478endif()
479
Ben Clayton5375f472019-06-24 13:33:11 +0100480if(REACTOR_VERIFY_LLVM_IR)
481 list(APPEND SWIFTSHADER_COMPILE_OPTIONS "-DENABLE_RR_LLVM_IR_VERIFICATION")
482endif()
483
Nicolas Capensbf8fd5b2018-06-21 00:42:00 -0400484if(WIN32)
Corentin Wallez0866b292015-12-09 13:49:40 -0500485 add_definitions(-DWINVER=0x501 -DNOMINMAX -DSTRICT)
Nicolas Capens6f422092015-12-23 15:12:45 -0500486 set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "" "lib")
Corentin Wallez0866b292015-12-09 13:49:40 -0500487endif()
488
Corentin Wallez0866b292015-12-09 13:49:40 -0500489###########################################################
490# LLVM
491###########################################################
492
Logan Chien0eedc8c2018-08-21 09:34:28 +0800493set(LLVM_LIST
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400494 ${LLVM_DIR}/lib/Analysis/AliasAnalysis.cpp
495 ${LLVM_DIR}/lib/Analysis/AliasAnalysisSummary.cpp
496 ${LLVM_DIR}/lib/Analysis/AliasSetTracker.cpp
497 ${LLVM_DIR}/lib/Analysis/AssumptionCache.cpp
498 ${LLVM_DIR}/lib/Analysis/BasicAliasAnalysis.cpp
499 ${LLVM_DIR}/lib/Analysis/BlockFrequencyInfo.cpp
500 ${LLVM_DIR}/lib/Analysis/BlockFrequencyInfoImpl.cpp
501 ${LLVM_DIR}/lib/Analysis/BranchProbabilityInfo.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400502 ${LLVM_DIR}/lib/Analysis/CallGraph.cpp
503 ${LLVM_DIR}/lib/Analysis/CallGraphSCCPass.cpp
504 ${LLVM_DIR}/lib/Analysis/CaptureTracking.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100505 ${LLVM_DIR}/lib/Analysis/CFG.cpp
506 ${LLVM_DIR}/lib/Analysis/CFLAndersAliasAnalysis.cpp
507 ${LLVM_DIR}/lib/Analysis/CFLSteensAliasAnalysis.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400508 ${LLVM_DIR}/lib/Analysis/CmpInstAnalysis.cpp
509 ${LLVM_DIR}/lib/Analysis/CodeMetrics.cpp
510 ${LLVM_DIR}/lib/Analysis/ConstantFolding.cpp
511 ${LLVM_DIR}/lib/Analysis/DemandedBits.cpp
512 ${LLVM_DIR}/lib/Analysis/DependenceAnalysis.cpp
513 ${LLVM_DIR}/lib/Analysis/DivergenceAnalysis.cpp
514 ${LLVM_DIR}/lib/Analysis/DominanceFrontier.cpp
515 ${LLVM_DIR}/lib/Analysis/EHPersonalities.cpp
516 ${LLVM_DIR}/lib/Analysis/GlobalsModRef.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400517 ${LLVM_DIR}/lib/Analysis/InlineCost.cpp
518 ${LLVM_DIR}/lib/Analysis/InstructionSimplify.cpp
519 ${LLVM_DIR}/lib/Analysis/IteratedDominanceFrontier.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100520 ${LLVM_DIR}/lib/Analysis/IVUsers.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400521 ${LLVM_DIR}/lib/Analysis/LazyBlockFrequencyInfo.cpp
522 ${LLVM_DIR}/lib/Analysis/LazyBranchProbabilityInfo.cpp
523 ${LLVM_DIR}/lib/Analysis/LazyValueInfo.cpp
524 ${LLVM_DIR}/lib/Analysis/Loads.cpp
525 ${LLVM_DIR}/lib/Analysis/LoopAnalysisManager.cpp
526 ${LLVM_DIR}/lib/Analysis/LoopInfo.cpp
527 ${LLVM_DIR}/lib/Analysis/LoopPass.cpp
528 ${LLVM_DIR}/lib/Analysis/MemoryBuiltins.cpp
529 ${LLVM_DIR}/lib/Analysis/MemoryDependenceAnalysis.cpp
530 ${LLVM_DIR}/lib/Analysis/MemoryLocation.cpp
531 ${LLVM_DIR}/lib/Analysis/MemorySSA.cpp
Ben Clayton1c82c7b2019-04-30 12:49:27 +0100532 ${LLVM_DIR}/lib/Analysis/MemorySSAUpdater.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400533 ${LLVM_DIR}/lib/Analysis/MustExecute.cpp
534 ${LLVM_DIR}/lib/Analysis/ObjCARCAliasAnalysis.cpp
535 ${LLVM_DIR}/lib/Analysis/ObjCARCAnalysisUtils.cpp
536 ${LLVM_DIR}/lib/Analysis/ObjCARCInstKind.cpp
537 ${LLVM_DIR}/lib/Analysis/OptimizationRemarkEmitter.cpp
538 ${LLVM_DIR}/lib/Analysis/OrderedBasicBlock.cpp
539 ${LLVM_DIR}/lib/Analysis/PHITransAddr.cpp
540 ${LLVM_DIR}/lib/Analysis/PhiValues.cpp
541 ${LLVM_DIR}/lib/Analysis/PostDominators.cpp
542 ${LLVM_DIR}/lib/Analysis/ProfileSummaryInfo.cpp
543 ${LLVM_DIR}/lib/Analysis/PtrUseVisitor.cpp
544 ${LLVM_DIR}/lib/Analysis/ScalarEvolution.cpp
545 ${LLVM_DIR}/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp
546 ${LLVM_DIR}/lib/Analysis/ScalarEvolutionExpander.cpp
547 ${LLVM_DIR}/lib/Analysis/ScalarEvolutionNormalization.cpp
548 ${LLVM_DIR}/lib/Analysis/ScopedNoAliasAA.cpp
549 ${LLVM_DIR}/lib/Analysis/TargetLibraryInfo.cpp
550 ${LLVM_DIR}/lib/Analysis/TargetTransformInfo.cpp
551 ${LLVM_DIR}/lib/Analysis/TypeBasedAliasAnalysis.cpp
552 ${LLVM_DIR}/lib/Analysis/ValueLattice.cpp
553 ${LLVM_DIR}/lib/Analysis/ValueLatticeUtils.cpp
554 ${LLVM_DIR}/lib/Analysis/ValueTracking.cpp
555 ${LLVM_DIR}/lib/Analysis/VectorUtils.cpp
556 ${LLVM_DIR}/lib/AsmParser/LLLexer.cpp
557 ${LLVM_DIR}/lib/AsmParser/LLParser.cpp
558 ${LLVM_DIR}/lib/AsmParser/Parser.cpp
559 ${LLVM_DIR}/lib/BinaryFormat/Dwarf.cpp
560 ${LLVM_DIR}/lib/BinaryFormat/Magic.cpp
561 ${LLVM_DIR}/lib/BinaryFormat/Wasm.cpp
562 ${LLVM_DIR}/lib/Bitcode/Reader/BitcodeReader.cpp
563 ${LLVM_DIR}/lib/Bitcode/Reader/BitstreamReader.cpp
564 ${LLVM_DIR}/lib/Bitcode/Reader/MetadataLoader.cpp
565 ${LLVM_DIR}/lib/Bitcode/Reader/ValueList.cpp
566 ${LLVM_DIR}/lib/CodeGen/AggressiveAntiDepBreaker.cpp
567 ${LLVM_DIR}/lib/CodeGen/AllocationOrder.cpp
568 ${LLVM_DIR}/lib/CodeGen/Analysis.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400569 ${LLVM_DIR}/lib/CodeGen/AsmPrinter/AccelTable.cpp
570 ${LLVM_DIR}/lib/CodeGen/AsmPrinter/AddressPool.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100571 ${LLVM_DIR}/lib/CodeGen/AsmPrinter/ARMException.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400572 ${LLVM_DIR}/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
573 ${LLVM_DIR}/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
574 ${LLVM_DIR}/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
575 ${LLVM_DIR}/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400576 ${LLVM_DIR}/lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp
577 ${LLVM_DIR}/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
578 ${LLVM_DIR}/lib/CodeGen/AsmPrinter/DebugLocStream.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100579 ${LLVM_DIR}/lib/CodeGen/AsmPrinter/DIE.cpp
580 ${LLVM_DIR}/lib/CodeGen/AsmPrinter/DIEHash.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400581 ${LLVM_DIR}/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
582 ${LLVM_DIR}/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
583 ${LLVM_DIR}/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
584 ${LLVM_DIR}/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
585 ${LLVM_DIR}/lib/CodeGen/AsmPrinter/DwarfFile.cpp
586 ${LLVM_DIR}/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp
587 ${LLVM_DIR}/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
588 ${LLVM_DIR}/lib/CodeGen/AsmPrinter/EHStreamer.cpp
589 ${LLVM_DIR}/lib/CodeGen/AsmPrinter/WinCFGuard.cpp
590 ${LLVM_DIR}/lib/CodeGen/AsmPrinter/WinException.cpp
591 ${LLVM_DIR}/lib/CodeGen/AtomicExpandPass.cpp
592 ${LLVM_DIR}/lib/CodeGen/BasicTargetTransformInfo.cpp
593 ${LLVM_DIR}/lib/CodeGen/BranchFolding.cpp
594 ${LLVM_DIR}/lib/CodeGen/BranchRelaxation.cpp
595 ${LLVM_DIR}/lib/CodeGen/BreakFalseDeps.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400596 ${LLVM_DIR}/lib/CodeGen/CalcSpillWeights.cpp
597 ${LLVM_DIR}/lib/CodeGen/CallingConvLower.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100598 ${LLVM_DIR}/lib/CodeGen/CFIInstrInserter.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400599 ${LLVM_DIR}/lib/CodeGen/CodeGen.cpp
600 ${LLVM_DIR}/lib/CodeGen/CodeGenPrepare.cpp
601 ${LLVM_DIR}/lib/CodeGen/CriticalAntiDepBreaker.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400602 ${LLVM_DIR}/lib/CodeGen/DeadMachineInstructionElim.cpp
603 ${LLVM_DIR}/lib/CodeGen/DetectDeadLanes.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100604 ${LLVM_DIR}/lib/CodeGen/DFAPacketizer.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400605 ${LLVM_DIR}/lib/CodeGen/DwarfEHPrepare.cpp
606 ${LLVM_DIR}/lib/CodeGen/EarlyIfConversion.cpp
607 ${LLVM_DIR}/lib/CodeGen/EdgeBundles.cpp
608 ${LLVM_DIR}/lib/CodeGen/ExecutionDomainFix.cpp
609 ${LLVM_DIR}/lib/CodeGen/ExpandISelPseudos.cpp
610 ${LLVM_DIR}/lib/CodeGen/ExpandMemCmp.cpp
611 ${LLVM_DIR}/lib/CodeGen/ExpandPostRAPseudos.cpp
612 ${LLVM_DIR}/lib/CodeGen/ExpandReductions.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400613 ${LLVM_DIR}/lib/CodeGen/FaultMaps.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100614 ${LLVM_DIR}/lib/CodeGen/FEntryInserter.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400615 ${LLVM_DIR}/lib/CodeGen/FuncletLayout.cpp
616 ${LLVM_DIR}/lib/CodeGen/GCMetadata.cpp
617 ${LLVM_DIR}/lib/CodeGen/GCMetadataPrinter.cpp
618 ${LLVM_DIR}/lib/CodeGen/GCRootLowering.cpp
619 ${LLVM_DIR}/lib/CodeGen/GCStrategy.cpp
620 ${LLVM_DIR}/lib/CodeGen/GlobalISel/CallLowering.cpp
621 ${LLVM_DIR}/lib/CodeGen/GlobalISel/GlobalISel.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400622 ${LLVM_DIR}/lib/CodeGen/GlobalISel/InstructionSelect.cpp
623 ${LLVM_DIR}/lib/CodeGen/GlobalISel/InstructionSelector.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100624 ${LLVM_DIR}/lib/CodeGen/GlobalISel/IRTranslator.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400625 ${LLVM_DIR}/lib/CodeGen/GlobalISel/LegalityPredicates.cpp
626 ${LLVM_DIR}/lib/CodeGen/GlobalISel/LegalizeMutations.cpp
627 ${LLVM_DIR}/lib/CodeGen/GlobalISel/Legalizer.cpp
628 ${LLVM_DIR}/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
629 ${LLVM_DIR}/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
630 ${LLVM_DIR}/lib/CodeGen/GlobalISel/Localizer.cpp
631 ${LLVM_DIR}/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
632 ${LLVM_DIR}/lib/CodeGen/GlobalISel/RegBankSelect.cpp
633 ${LLVM_DIR}/lib/CodeGen/GlobalISel/RegisterBank.cpp
634 ${LLVM_DIR}/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp
635 ${LLVM_DIR}/lib/CodeGen/GlobalISel/Utils.cpp
636 ${LLVM_DIR}/lib/CodeGen/IfConversion.cpp
637 ${LLVM_DIR}/lib/CodeGen/ImplicitNullChecks.cpp
638 ${LLVM_DIR}/lib/CodeGen/IndirectBrExpandPass.cpp
639 ${LLVM_DIR}/lib/CodeGen/InlineSpiller.cpp
640 ${LLVM_DIR}/lib/CodeGen/InterferenceCache.cpp
641 ${LLVM_DIR}/lib/CodeGen/InterleavedAccessPass.cpp
642 ${LLVM_DIR}/lib/CodeGen/IntrinsicLowering.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400643 ${LLVM_DIR}/lib/CodeGen/LatencyPriorityQueue.cpp
644 ${LLVM_DIR}/lib/CodeGen/LazyMachineBlockFrequencyInfo.cpp
645 ${LLVM_DIR}/lib/CodeGen/LexicalScopes.cpp
646 ${LLVM_DIR}/lib/CodeGen/LiveDebugValues.cpp
647 ${LLVM_DIR}/lib/CodeGen/LiveDebugVariables.cpp
648 ${LLVM_DIR}/lib/CodeGen/LiveInterval.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400649 ${LLVM_DIR}/lib/CodeGen/LiveIntervals.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100650 ${LLVM_DIR}/lib/CodeGen/LiveIntervalUnion.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400651 ${LLVM_DIR}/lib/CodeGen/LivePhysRegs.cpp
652 ${LLVM_DIR}/lib/CodeGen/LiveRangeCalc.cpp
653 ${LLVM_DIR}/lib/CodeGen/LiveRangeEdit.cpp
654 ${LLVM_DIR}/lib/CodeGen/LiveRangeShrink.cpp
655 ${LLVM_DIR}/lib/CodeGen/LiveRegMatrix.cpp
656 ${LLVM_DIR}/lib/CodeGen/LiveRegUnits.cpp
657 ${LLVM_DIR}/lib/CodeGen/LiveStacks.cpp
658 ${LLVM_DIR}/lib/CodeGen/LiveVariables.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100659 ${LLVM_DIR}/lib/CodeGen/LLVMTargetMachine.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400660 ${LLVM_DIR}/lib/CodeGen/LocalStackSlotAllocation.cpp
661 ${LLVM_DIR}/lib/CodeGen/LoopTraversal.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400662 ${LLVM_DIR}/lib/CodeGen/LowerEmuTLS.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100663 ${LLVM_DIR}/lib/CodeGen/LowLevelType.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400664 ${LLVM_DIR}/lib/CodeGen/MachineBasicBlock.cpp
665 ${LLVM_DIR}/lib/CodeGen/MachineBlockFrequencyInfo.cpp
666 ${LLVM_DIR}/lib/CodeGen/MachineBlockPlacement.cpp
667 ${LLVM_DIR}/lib/CodeGen/MachineBranchProbabilityInfo.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400668 ${LLVM_DIR}/lib/CodeGen/MachineCombiner.cpp
669 ${LLVM_DIR}/lib/CodeGen/MachineCopyPropagation.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100670 ${LLVM_DIR}/lib/CodeGen/MachineCSE.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400671 ${LLVM_DIR}/lib/CodeGen/MachineDominanceFrontier.cpp
672 ${LLVM_DIR}/lib/CodeGen/MachineDominators.cpp
673 ${LLVM_DIR}/lib/CodeGen/MachineFrameInfo.cpp
674 ${LLVM_DIR}/lib/CodeGen/MachineFunction.cpp
675 ${LLVM_DIR}/lib/CodeGen/MachineFunctionPass.cpp
676 ${LLVM_DIR}/lib/CodeGen/MachineFunctionPrinterPass.cpp
677 ${LLVM_DIR}/lib/CodeGen/MachineInstr.cpp
678 ${LLVM_DIR}/lib/CodeGen/MachineInstrBundle.cpp
679 ${LLVM_DIR}/lib/CodeGen/MachineLICM.cpp
680 ${LLVM_DIR}/lib/CodeGen/MachineLoopInfo.cpp
681 ${LLVM_DIR}/lib/CodeGen/MachineModuleInfo.cpp
682 ${LLVM_DIR}/lib/CodeGen/MachineModuleInfoImpls.cpp
683 ${LLVM_DIR}/lib/CodeGen/MachineOperand.cpp
684 ${LLVM_DIR}/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp
685 ${LLVM_DIR}/lib/CodeGen/MachineOutliner.cpp
686 ${LLVM_DIR}/lib/CodeGen/MachinePassRegistry.cpp
687 ${LLVM_DIR}/lib/CodeGen/MachinePipeliner.cpp
688 ${LLVM_DIR}/lib/CodeGen/MachinePostDominators.cpp
689 ${LLVM_DIR}/lib/CodeGen/MachineRegionInfo.cpp
690 ${LLVM_DIR}/lib/CodeGen/MachineRegisterInfo.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400691 ${LLVM_DIR}/lib/CodeGen/MachineScheduler.cpp
692 ${LLVM_DIR}/lib/CodeGen/MachineSink.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100693 ${LLVM_DIR}/lib/CodeGen/MachineSSAUpdater.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400694 ${LLVM_DIR}/lib/CodeGen/MachineTraceMetrics.cpp
695 ${LLVM_DIR}/lib/CodeGen/MachineVerifier.cpp
696 ${LLVM_DIR}/lib/CodeGen/MacroFusion.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100697 ${LLVM_DIR}/lib/CodeGen/MIRCanonicalizerPass.cpp
698 ${LLVM_DIR}/lib/CodeGen/MIRPrinter.cpp
699 ${LLVM_DIR}/lib/CodeGen/MIRPrintingPass.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400700 ${LLVM_DIR}/lib/CodeGen/OptimizePHIs.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400701 ${LLVM_DIR}/lib/CodeGen/PatchableFunction.cpp
702 ${LLVM_DIR}/lib/CodeGen/PeepholeOptimizer.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100703 ${LLVM_DIR}/lib/CodeGen/PHIElimination.cpp
704 ${LLVM_DIR}/lib/CodeGen/PHIEliminationUtils.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400705 ${LLVM_DIR}/lib/CodeGen/PostRAHazardRecognizer.cpp
706 ${LLVM_DIR}/lib/CodeGen/PostRASchedulerList.cpp
707 ${LLVM_DIR}/lib/CodeGen/PreISelIntrinsicLowering.cpp
708 ${LLVM_DIR}/lib/CodeGen/ProcessImplicitDefs.cpp
709 ${LLVM_DIR}/lib/CodeGen/PrologEpilogInserter.cpp
710 ${LLVM_DIR}/lib/CodeGen/PseudoSourceValue.cpp
711 ${LLVM_DIR}/lib/CodeGen/ReachingDefAnalysis.cpp
712 ${LLVM_DIR}/lib/CodeGen/RegAllocBase.cpp
713 ${LLVM_DIR}/lib/CodeGen/RegAllocBasic.cpp
714 ${LLVM_DIR}/lib/CodeGen/RegAllocFast.cpp
715 ${LLVM_DIR}/lib/CodeGen/RegAllocGreedy.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400716 ${LLVM_DIR}/lib/CodeGen/RegisterClassInfo.cpp
717 ${LLVM_DIR}/lib/CodeGen/RegisterCoalescer.cpp
718 ${LLVM_DIR}/lib/CodeGen/RegisterPressure.cpp
719 ${LLVM_DIR}/lib/CodeGen/RegisterScavenging.cpp
720 ${LLVM_DIR}/lib/CodeGen/RegisterUsageInfo.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100721 ${LLVM_DIR}/lib/CodeGen/RegUsageInfoCollector.cpp
722 ${LLVM_DIR}/lib/CodeGen/RegUsageInfoPropagate.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400723 ${LLVM_DIR}/lib/CodeGen/RenameIndependentSubregs.cpp
724 ${LLVM_DIR}/lib/CodeGen/ResetMachineFunctionPass.cpp
725 ${LLVM_DIR}/lib/CodeGen/SafeStack.cpp
726 ${LLVM_DIR}/lib/CodeGen/SafeStackColoring.cpp
727 ${LLVM_DIR}/lib/CodeGen/SafeStackLayout.cpp
728 ${LLVM_DIR}/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp
729 ${LLVM_DIR}/lib/CodeGen/ScheduleDAG.cpp
730 ${LLVM_DIR}/lib/CodeGen/ScheduleDAGInstrs.cpp
731 ${LLVM_DIR}/lib/CodeGen/ScheduleDAGPrinter.cpp
732 ${LLVM_DIR}/lib/CodeGen/ScoreboardHazardRecognizer.cpp
733 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
734 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/FastISel.cpp
735 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
736 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
737 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
738 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
739 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
740 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
741 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp
742 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
743 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
744 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp
745 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
746 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
747 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/ScheduleDAGVLIW.cpp
748 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
749 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
750 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
751 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
752 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
753 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
754 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/SelectionDAGTargetInfo.cpp
755 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
756 ${LLVM_DIR}/lib/CodeGen/SelectionDAG/TargetLowering.cpp
757 ${LLVM_DIR}/lib/CodeGen/ShadowStackGCLowering.cpp
758 ${LLVM_DIR}/lib/CodeGen/ShrinkWrap.cpp
759 ${LLVM_DIR}/lib/CodeGen/SjLjEHPrepare.cpp
760 ${LLVM_DIR}/lib/CodeGen/SlotIndexes.cpp
761 ${LLVM_DIR}/lib/CodeGen/SpillPlacement.cpp
762 ${LLVM_DIR}/lib/CodeGen/SplitKit.cpp
763 ${LLVM_DIR}/lib/CodeGen/StackColoring.cpp
764 ${LLVM_DIR}/lib/CodeGen/StackMapLivenessAnalysis.cpp
765 ${LLVM_DIR}/lib/CodeGen/StackMaps.cpp
766 ${LLVM_DIR}/lib/CodeGen/StackProtector.cpp
767 ${LLVM_DIR}/lib/CodeGen/StackSlotColoring.cpp
768 ${LLVM_DIR}/lib/CodeGen/TailDuplication.cpp
769 ${LLVM_DIR}/lib/CodeGen/TailDuplicator.cpp
770 ${LLVM_DIR}/lib/CodeGen/TargetFrameLoweringImpl.cpp
771 ${LLVM_DIR}/lib/CodeGen/TargetInstrInfo.cpp
772 ${LLVM_DIR}/lib/CodeGen/TargetLoweringBase.cpp
773 ${LLVM_DIR}/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
774 ${LLVM_DIR}/lib/CodeGen/TargetOptionsImpl.cpp
775 ${LLVM_DIR}/lib/CodeGen/TargetPassConfig.cpp
776 ${LLVM_DIR}/lib/CodeGen/TargetRegisterInfo.cpp
777 ${LLVM_DIR}/lib/CodeGen/TargetSchedule.cpp
778 ${LLVM_DIR}/lib/CodeGen/TargetSubtargetInfo.cpp
779 ${LLVM_DIR}/lib/CodeGen/TwoAddressInstructionPass.cpp
780 ${LLVM_DIR}/lib/CodeGen/UnreachableBlockElim.cpp
781 ${LLVM_DIR}/lib/CodeGen/ValueTypes.cpp
782 ${LLVM_DIR}/lib/CodeGen/VirtRegMap.cpp
783 ${LLVM_DIR}/lib/CodeGen/WasmEHPrepare.cpp
784 ${LLVM_DIR}/lib/CodeGen/WinEHPrepare.cpp
785 ${LLVM_DIR}/lib/CodeGen/XRayInstrumentation.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400786 ${LLVM_DIR}/lib/DebugInfo/CodeView/CodeViewError.cpp
787 ${LLVM_DIR}/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp
788 ${LLVM_DIR}/lib/DebugInfo/CodeView/ContinuationRecordBuilder.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100789 ${LLVM_DIR}/lib/DebugInfo/CodeView/CVTypeVisitor.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400790 ${LLVM_DIR}/lib/DebugInfo/CodeView/Formatters.cpp
791 ${LLVM_DIR}/lib/DebugInfo/CodeView/GlobalTypeTableBuilder.cpp
792 ${LLVM_DIR}/lib/DebugInfo/CodeView/Line.cpp
793 ${LLVM_DIR}/lib/DebugInfo/CodeView/RecordName.cpp
794 ${LLVM_DIR}/lib/DebugInfo/CodeView/RecordSerialization.cpp
795 ${LLVM_DIR}/lib/DebugInfo/CodeView/SimpleTypeSerializer.cpp
796 ${LLVM_DIR}/lib/DebugInfo/CodeView/SymbolRecordMapping.cpp
797 ${LLVM_DIR}/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp
798 ${LLVM_DIR}/lib/DebugInfo/CodeView/TypeHashing.cpp
799 ${LLVM_DIR}/lib/DebugInfo/CodeView/TypeIndex.cpp
800 ${LLVM_DIR}/lib/DebugInfo/CodeView/TypeIndexDiscovery.cpp
801 ${LLVM_DIR}/lib/DebugInfo/CodeView/TypeRecordMapping.cpp
802 ${LLVM_DIR}/lib/DebugInfo/CodeView/TypeTableCollection.cpp
803 ${LLVM_DIR}/lib/ExecutionEngine/ExecutionEngine.cpp
804 ${LLVM_DIR}/lib/ExecutionEngine/GDBRegistrationListener.cpp
805 ${LLVM_DIR}/lib/ExecutionEngine/Orc/Core.cpp
806 ${LLVM_DIR}/lib/ExecutionEngine/Orc/Legacy.cpp
807 ${LLVM_DIR}/lib/ExecutionEngine/Orc/OrcError.cpp
808 ${LLVM_DIR}/lib/ExecutionEngine/RuntimeDyld/JITSymbol.cpp
809 ${LLVM_DIR}/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp
810 ${LLVM_DIR}/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400811 ${LLVM_DIR}/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100812 ${LLVM_DIR}/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400813 ${LLVM_DIR}/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
814 ${LLVM_DIR}/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
815 ${LLVM_DIR}/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldELFMips.cpp
816 ${LLVM_DIR}/lib/ExecutionEngine/SectionMemoryManager.cpp
817 ${LLVM_DIR}/lib/ExecutionEngine/TargetSelect.cpp
818 ${LLVM_DIR}/lib/IR/AsmWriter.cpp
819 ${LLVM_DIR}/lib/IR/Attributes.cpp
820 ${LLVM_DIR}/lib/IR/AutoUpgrade.cpp
821 ${LLVM_DIR}/lib/IR/BasicBlock.cpp
822 ${LLVM_DIR}/lib/IR/Comdat.cpp
823 ${LLVM_DIR}/lib/IR/ConstantFold.cpp
824 ${LLVM_DIR}/lib/IR/ConstantRange.cpp
825 ${LLVM_DIR}/lib/IR/Constants.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400826 ${LLVM_DIR}/lib/IR/DataLayout.cpp
827 ${LLVM_DIR}/lib/IR/DebugInfo.cpp
828 ${LLVM_DIR}/lib/IR/DebugInfoMetadata.cpp
829 ${LLVM_DIR}/lib/IR/DebugLoc.cpp
830 ${LLVM_DIR}/lib/IR/DiagnosticHandler.cpp
831 ${LLVM_DIR}/lib/IR/DiagnosticInfo.cpp
832 ${LLVM_DIR}/lib/IR/DiagnosticPrinter.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100833 ${LLVM_DIR}/lib/IR/DIBuilder.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400834 ${LLVM_DIR}/lib/IR/Dominators.cpp
835 ${LLVM_DIR}/lib/IR/Function.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400836 ${LLVM_DIR}/lib/IR/Globals.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100837 ${LLVM_DIR}/lib/IR/GVMaterializer.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400838 ${LLVM_DIR}/lib/IR/InlineAsm.cpp
839 ${LLVM_DIR}/lib/IR/Instruction.cpp
840 ${LLVM_DIR}/lib/IR/Instructions.cpp
841 ${LLVM_DIR}/lib/IR/IntrinsicInst.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100842 ${LLVM_DIR}/lib/IR/IRBuilder.cpp
843 ${LLVM_DIR}/lib/IR/IRPrintingPasses.cpp
844 ${LLVM_DIR}/lib/IR/LegacyPassManager.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400845 ${LLVM_DIR}/lib/IR/LLVMContext.cpp
846 ${LLVM_DIR}/lib/IR/LLVMContextImpl.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400847 ${LLVM_DIR}/lib/IR/Mangler.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100848 ${LLVM_DIR}/lib/IR/MDBuilder.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400849 ${LLVM_DIR}/lib/IR/Metadata.cpp
850 ${LLVM_DIR}/lib/IR/Module.cpp
851 ${LLVM_DIR}/lib/IR/Operator.cpp
852 ${LLVM_DIR}/lib/IR/OptBisect.cpp
853 ${LLVM_DIR}/lib/IR/Pass.cpp
854 ${LLVM_DIR}/lib/IR/PassManager.cpp
855 ${LLVM_DIR}/lib/IR/PassRegistry.cpp
856 ${LLVM_DIR}/lib/IR/ProfileSummary.cpp
857 ${LLVM_DIR}/lib/IR/Statepoint.cpp
858 ${LLVM_DIR}/lib/IR/Type.cpp
859 ${LLVM_DIR}/lib/IR/TypeFinder.cpp
860 ${LLVM_DIR}/lib/IR/Use.cpp
861 ${LLVM_DIR}/lib/IR/User.cpp
862 ${LLVM_DIR}/lib/IR/Value.cpp
863 ${LLVM_DIR}/lib/IR/ValueSymbolTable.cpp
864 ${LLVM_DIR}/lib/IR/Verifier.cpp
865 ${LLVM_DIR}/lib/MC/ELFObjectWriter.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100866 ${LLVM_DIR}/lib/MC/MachObjectWriter.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400867 ${LLVM_DIR}/lib/MC/MCAsmBackend.cpp
868 ${LLVM_DIR}/lib/MC/MCAsmInfo.cpp
869 ${LLVM_DIR}/lib/MC/MCAsmInfoCOFF.cpp
870 ${LLVM_DIR}/lib/MC/MCAsmInfoDarwin.cpp
871 ${LLVM_DIR}/lib/MC/MCAsmInfoELF.cpp
872 ${LLVM_DIR}/lib/MC/MCAsmMacro.cpp
873 ${LLVM_DIR}/lib/MC/MCAsmStreamer.cpp
874 ${LLVM_DIR}/lib/MC/MCAssembler.cpp
875 ${LLVM_DIR}/lib/MC/MCCodeEmitter.cpp
876 ${LLVM_DIR}/lib/MC/MCCodePadder.cpp
877 ${LLVM_DIR}/lib/MC/MCCodeView.cpp
878 ${LLVM_DIR}/lib/MC/MCContext.cpp
879 ${LLVM_DIR}/lib/MC/MCDisassembler/MCRelocationInfo.cpp
880 ${LLVM_DIR}/lib/MC/MCDwarf.cpp
881 ${LLVM_DIR}/lib/MC/MCELFObjectTargetWriter.cpp
882 ${LLVM_DIR}/lib/MC/MCELFStreamer.cpp
883 ${LLVM_DIR}/lib/MC/MCExpr.cpp
884 ${LLVM_DIR}/lib/MC/MCFragment.cpp
885 ${LLVM_DIR}/lib/MC/MCInst.cpp
886 ${LLVM_DIR}/lib/MC/MCInstPrinter.cpp
887 ${LLVM_DIR}/lib/MC/MCInstrAnalysis.cpp
888 ${LLVM_DIR}/lib/MC/MCInstrDesc.cpp
889 ${LLVM_DIR}/lib/MC/MCLinkerOptimizationHint.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400890 ${LLVM_DIR}/lib/MC/MCMachObjectTargetWriter.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100891 ${LLVM_DIR}/lib/MC/MCMachOStreamer.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400892 ${LLVM_DIR}/lib/MC/MCNullStreamer.cpp
893 ${LLVM_DIR}/lib/MC/MCObjectFileInfo.cpp
894 ${LLVM_DIR}/lib/MC/MCObjectStreamer.cpp
895 ${LLVM_DIR}/lib/MC/MCObjectWriter.cpp
896 ${LLVM_DIR}/lib/MC/MCParser/AsmLexer.cpp
897 ${LLVM_DIR}/lib/MC/MCParser/AsmParser.cpp
898 ${LLVM_DIR}/lib/MC/MCParser/COFFAsmParser.cpp
899 ${LLVM_DIR}/lib/MC/MCParser/DarwinAsmParser.cpp
900 ${LLVM_DIR}/lib/MC/MCParser/ELFAsmParser.cpp
901 ${LLVM_DIR}/lib/MC/MCParser/MCAsmLexer.cpp
902 ${LLVM_DIR}/lib/MC/MCParser/MCAsmParser.cpp
903 ${LLVM_DIR}/lib/MC/MCParser/MCAsmParserExtension.cpp
904 ${LLVM_DIR}/lib/MC/MCParser/MCTargetAsmParser.cpp
905 ${LLVM_DIR}/lib/MC/MCRegisterInfo.cpp
906 ${LLVM_DIR}/lib/MC/MCSchedule.cpp
907 ${LLVM_DIR}/lib/MC/MCSection.cpp
908 ${LLVM_DIR}/lib/MC/MCSectionCOFF.cpp
909 ${LLVM_DIR}/lib/MC/MCSectionELF.cpp
910 ${LLVM_DIR}/lib/MC/MCSectionMachO.cpp
911 ${LLVM_DIR}/lib/MC/MCSectionWasm.cpp
912 ${LLVM_DIR}/lib/MC/MCStreamer.cpp
913 ${LLVM_DIR}/lib/MC/MCSubtargetInfo.cpp
914 ${LLVM_DIR}/lib/MC/MCSymbol.cpp
915 ${LLVM_DIR}/lib/MC/MCSymbolELF.cpp
916 ${LLVM_DIR}/lib/MC/MCTargetOptions.cpp
917 ${LLVM_DIR}/lib/MC/MCValue.cpp
918 ${LLVM_DIR}/lib/MC/MCWasmStreamer.cpp
919 ${LLVM_DIR}/lib/MC/MCWin64EH.cpp
920 ${LLVM_DIR}/lib/MC/MCWinCOFFStreamer.cpp
921 ${LLVM_DIR}/lib/MC/MCWinEH.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400922 ${LLVM_DIR}/lib/MC/StringTableBuilder.cpp
923 ${LLVM_DIR}/lib/MC/SubtargetFeature.cpp
924 ${LLVM_DIR}/lib/MC/WasmObjectWriter.cpp
925 ${LLVM_DIR}/lib/MC/WinCOFFObjectWriter.cpp
926 ${LLVM_DIR}/lib/Object/Archive.cpp
927 ${LLVM_DIR}/lib/Object/Binary.cpp
928 ${LLVM_DIR}/lib/Object/COFFObjectFile.cpp
929 ${LLVM_DIR}/lib/Object/ELF.cpp
930 ${LLVM_DIR}/lib/Object/ELFObjectFile.cpp
931 ${LLVM_DIR}/lib/Object/Error.cpp
932 ${LLVM_DIR}/lib/Object/IRObjectFile.cpp
933 ${LLVM_DIR}/lib/Object/IRSymtab.cpp
934 ${LLVM_DIR}/lib/Object/MachOObjectFile.cpp
935 ${LLVM_DIR}/lib/Object/MachOUniversal.cpp
936 ${LLVM_DIR}/lib/Object/ModuleSymbolTable.cpp
937 ${LLVM_DIR}/lib/Object/ObjectFile.cpp
938 ${LLVM_DIR}/lib/Object/RecordStreamer.cpp
939 ${LLVM_DIR}/lib/Object/SymbolicFile.cpp
940 ${LLVM_DIR}/lib/Object/WasmObjectFile.cpp
941 ${LLVM_DIR}/lib/Object/WindowsResource.cpp
942 ${LLVM_DIR}/lib/ProfileData/InstrProf.cpp
943 ${LLVM_DIR}/lib/Support/APFloat.cpp
944 ${LLVM_DIR}/lib/Support/APInt.cpp
Nicolas Capens8c7da802019-04-29 11:52:35 -0400945 ${LLVM_DIR}/lib/Support/APSInt.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400946 ${LLVM_DIR}/lib/Support/ARMAttributeParser.cpp
947 ${LLVM_DIR}/lib/Support/ARMBuildAttrs.cpp
Colin Samplesf63a3ab2019-06-13 12:53:09 -0400948 ${LLVM_DIR}/lib/Support/Atomic.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400949 ${LLVM_DIR}/lib/Support/BinaryStreamError.cpp
950 ${LLVM_DIR}/lib/Support/BinaryStreamReader.cpp
951 ${LLVM_DIR}/lib/Support/BinaryStreamRef.cpp
952 ${LLVM_DIR}/lib/Support/BinaryStreamWriter.cpp
953 ${LLVM_DIR}/lib/Support/BlockFrequency.cpp
954 ${LLVM_DIR}/lib/Support/BranchProbability.cpp
955 ${LLVM_DIR}/lib/Support/Chrono.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100956 ${LLVM_DIR}/lib/Support/circular_raw_ostream.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400957 ${LLVM_DIR}/lib/Support/CodeGenCoverage.cpp
958 ${LLVM_DIR}/lib/Support/CommandLine.cpp
959 ${LLVM_DIR}/lib/Support/Compression.cpp
960 ${LLVM_DIR}/lib/Support/ConvertUTF.cpp
961 ${LLVM_DIR}/lib/Support/ConvertUTFWrapper.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400962 ${LLVM_DIR}/lib/Support/DataExtractor.cpp
963 ${LLVM_DIR}/lib/Support/Debug.cpp
964 ${LLVM_DIR}/lib/Support/DebugCounter.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100965 ${LLVM_DIR}/lib/Support/DJB.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400966 ${LLVM_DIR}/lib/Support/DynamicLibrary.cpp
967 ${LLVM_DIR}/lib/Support/Errno.cpp
968 ${LLVM_DIR}/lib/Support/Error.cpp
969 ${LLVM_DIR}/lib/Support/ErrorHandling.cpp
970 ${LLVM_DIR}/lib/Support/FoldingSet.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400971 ${LLVM_DIR}/lib/Support/FormattedStream.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100972 ${LLVM_DIR}/lib/Support/FormatVariadic.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400973 ${LLVM_DIR}/lib/Support/GraphWriter.cpp
974 ${LLVM_DIR}/lib/Support/Hashing.cpp
975 ${LLVM_DIR}/lib/Support/Host.cpp
976 ${LLVM_DIR}/lib/Support/IntEqClasses.cpp
977 ${LLVM_DIR}/lib/Support/IntervalMap.cpp
978 ${LLVM_DIR}/lib/Support/JamCRC.cpp
979 ${LLVM_DIR}/lib/Support/KnownBits.cpp
980 ${LLVM_DIR}/lib/Support/LEB128.cpp
981 ${LLVM_DIR}/lib/Support/LineIterator.cpp
982 ${LLVM_DIR}/lib/Support/Locale.cpp
983 ${LLVM_DIR}/lib/Support/LowLevelType.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400984 ${LLVM_DIR}/lib/Support/ManagedStatic.cpp
985 ${LLVM_DIR}/lib/Support/MathExtras.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100986 ${LLVM_DIR}/lib/Support/MD5.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400987 ${LLVM_DIR}/lib/Support/Memory.cpp
988 ${LLVM_DIR}/lib/Support/MemoryBuffer.cpp
989 ${LLVM_DIR}/lib/Support/Mutex.cpp
990 ${LLVM_DIR}/lib/Support/NativeFormatting.cpp
991 ${LLVM_DIR}/lib/Support/Path.cpp
992 ${LLVM_DIR}/lib/Support/PrettyStackTrace.cpp
993 ${LLVM_DIR}/lib/Support/Process.cpp
994 ${LLVM_DIR}/lib/Support/Program.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400995 ${LLVM_DIR}/lib/Support/RandomNumberGenerator.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +0100996 ${LLVM_DIR}/lib/Support/raw_ostream.cpp
997 ${LLVM_DIR}/lib/Support/regcomp.c
998 ${LLVM_DIR}/lib/Support/regerror.c
Nicolas Capens9ac24a92019-04-29 10:45:56 -0400999 ${LLVM_DIR}/lib/Support/Regex.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001000 ${LLVM_DIR}/lib/Support/regexec.c
1001 ${LLVM_DIR}/lib/Support/regfree.c
1002 ${LLVM_DIR}/lib/Support/regstrlcpy.c
1003 ${LLVM_DIR}/lib/Support/RWMutex.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -04001004 ${LLVM_DIR}/lib/Support/ScaledNumber.cpp
1005 ${LLVM_DIR}/lib/Support/ScopedPrinter.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001006 ${LLVM_DIR}/lib/Support/SHA1.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -04001007 ${LLVM_DIR}/lib/Support/Signals.cpp
1008 ${LLVM_DIR}/lib/Support/SmallPtrSet.cpp
1009 ${LLVM_DIR}/lib/Support/SmallVector.cpp
1010 ${LLVM_DIR}/lib/Support/SourceMgr.cpp
1011 ${LLVM_DIR}/lib/Support/Statistic.cpp
1012 ${LLVM_DIR}/lib/Support/StringExtras.cpp
1013 ${LLVM_DIR}/lib/Support/StringMap.cpp
1014 ${LLVM_DIR}/lib/Support/StringRef.cpp
1015 ${LLVM_DIR}/lib/Support/StringSaver.cpp
1016 ${LLVM_DIR}/lib/Support/TargetParser.cpp
1017 ${LLVM_DIR}/lib/Support/TargetRegistry.cpp
1018 ${LLVM_DIR}/lib/Support/Threading.cpp
1019 ${LLVM_DIR}/lib/Support/Timer.cpp
1020 ${LLVM_DIR}/lib/Support/ToolOutputFile.cpp
1021 ${LLVM_DIR}/lib/Support/Triple.cpp
1022 ${LLVM_DIR}/lib/Support/Twine.cpp
1023 ${LLVM_DIR}/lib/Support/Unicode.cpp
1024 ${LLVM_DIR}/lib/Support/UnicodeCaseFold.cpp
1025 ${LLVM_DIR}/lib/Support/Valgrind.cpp
1026 ${LLVM_DIR}/lib/Support/YAMLParser.cpp
1027 ${LLVM_DIR}/lib/Support/YAMLTraits.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -04001028 ${LLVM_DIR}/lib/Target/TargetLoweringObjectFile.cpp
1029 ${LLVM_DIR}/lib/Target/TargetMachine.cpp
Ben Clayton1c82c7b2019-04-30 12:49:27 +01001030 ${LLVM_DIR}/lib/Transforms/Coroutines/CoroCleanup.cpp
1031 ${LLVM_DIR}/lib/Transforms/Coroutines/CoroEarly.cpp
1032 ${LLVM_DIR}/lib/Transforms/Coroutines/CoroElide.cpp
1033 ${LLVM_DIR}/lib/Transforms/Coroutines/CoroFrame.cpp
1034 ${LLVM_DIR}/lib/Transforms/Coroutines/CoroSplit.cpp
1035 ${LLVM_DIR}/lib/Transforms/Coroutines/Coroutines.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -04001036 ${LLVM_DIR}/lib/Transforms/InstCombine/InstCombineAddSub.cpp
1037 ${LLVM_DIR}/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
1038 ${LLVM_DIR}/lib/Transforms/InstCombine/InstCombineCalls.cpp
1039 ${LLVM_DIR}/lib/Transforms/InstCombine/InstCombineCasts.cpp
1040 ${LLVM_DIR}/lib/Transforms/InstCombine/InstCombineCompares.cpp
1041 ${LLVM_DIR}/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
1042 ${LLVM_DIR}/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
1043 ${LLVM_DIR}/lib/Transforms/InstCombine/InstCombinePHI.cpp
1044 ${LLVM_DIR}/lib/Transforms/InstCombine/InstCombineSelect.cpp
1045 ${LLVM_DIR}/lib/Transforms/InstCombine/InstCombineShifts.cpp
1046 ${LLVM_DIR}/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
1047 ${LLVM_DIR}/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
1048 ${LLVM_DIR}/lib/Transforms/InstCombine/InstructionCombining.cpp
Ben Clayton1c82c7b2019-04-30 12:49:27 +01001049 ${LLVM_DIR}/lib/Transforms/IPO/BarrierNoopPass.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -04001050 ${LLVM_DIR}/lib/Transforms/Scalar/ADCE.cpp
1051 ${LLVM_DIR}/lib/Transforms/Scalar/ConstantHoisting.cpp
1052 ${LLVM_DIR}/lib/Transforms/Scalar/DeadStoreElimination.cpp
Ben Clayton1c82c7b2019-04-30 12:49:27 +01001053 ${LLVM_DIR}/lib/Transforms/Scalar/EarlyCSE.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -04001054 ${LLVM_DIR}/lib/Transforms/Scalar/GVN.cpp
1055 ${LLVM_DIR}/lib/Transforms/Scalar/LICM.cpp
Colin Samplesf63a3ab2019-06-13 12:53:09 -04001056 ${LLVM_DIR}/lib/Transforms/Scalar/LoopDataPrefetch.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -04001057 ${LLVM_DIR}/lib/Transforms/Scalar/LoopStrengthReduce.cpp
1058 ${LLVM_DIR}/lib/Transforms/Scalar/MergeICmps.cpp
1059 ${LLVM_DIR}/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp
1060 ${LLVM_DIR}/lib/Transforms/Scalar/Reassociate.cpp
1061 ${LLVM_DIR}/lib/Transforms/Scalar/SCCP.cpp
Colin Samplesf63a3ab2019-06-13 12:53:09 -04001062 ${LLVM_DIR}/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -04001063 ${LLVM_DIR}/lib/Transforms/Scalar/SimplifyCFGPass.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001064 ${LLVM_DIR}/lib/Transforms/Scalar/SROA.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -04001065 ${LLVM_DIR}/lib/Transforms/Utils/BasicBlockUtils.cpp
1066 ${LLVM_DIR}/lib/Transforms/Utils/BreakCriticalEdges.cpp
1067 ${LLVM_DIR}/lib/Transforms/Utils/BuildLibCalls.cpp
1068 ${LLVM_DIR}/lib/Transforms/Utils/BypassSlowDivision.cpp
1069 ${LLVM_DIR}/lib/Transforms/Utils/CloneFunction.cpp
1070 ${LLVM_DIR}/lib/Transforms/Utils/DemoteRegToStack.cpp
1071 ${LLVM_DIR}/lib/Transforms/Utils/EntryExitInstrumenter.cpp
1072 ${LLVM_DIR}/lib/Transforms/Utils/EscapeEnumerator.cpp
1073 ${LLVM_DIR}/lib/Transforms/Utils/InlineFunction.cpp
1074 ${LLVM_DIR}/lib/Transforms/Utils/LCSSA.cpp
1075 ${LLVM_DIR}/lib/Transforms/Utils/Local.cpp
1076 ${LLVM_DIR}/lib/Transforms/Utils/LoopSimplify.cpp
1077 ${LLVM_DIR}/lib/Transforms/Utils/LoopUtils.cpp
1078 ${LLVM_DIR}/lib/Transforms/Utils/LowerInvoke.cpp
1079 ${LLVM_DIR}/lib/Transforms/Utils/OrderedInstructions.cpp
1080 ${LLVM_DIR}/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -04001081 ${LLVM_DIR}/lib/Transforms/Utils/SimplifyCFG.cpp
1082 ${LLVM_DIR}/lib/Transforms/Utils/SimplifyLibCalls.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001083 ${LLVM_DIR}/lib/Transforms/Utils/SSAUpdater.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -04001084 ${LLVM_DIR}/lib/Transforms/Utils/SymbolRewriter.cpp
Nicolas Capens9ac24a92019-04-29 10:45:56 -04001085 ${LLVM_DIR}/lib/Transforms/Utils/ValueMapper.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001086 ${LLVM_DIR}/lib/Transforms/Utils/VNCoercion.cpp
Ben Clayton1c82c7b2019-04-30 12:49:27 +01001087 ${LLVM_DIR}/../stubs/Stubs.cpp
Logan Chien0eedc8c2018-08-21 09:34:28 +08001088)
1089
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001090if(ARCH STREQUAL "x86" OR ARCH STREQUAL "x86_64")
1091 list(APPEND LLVM_LIST
1092 ${LLVM_DIR}/lib/Target/X86/AsmParser/X86AsmInstrumentation.cpp
1093 ${LLVM_DIR}/lib/Target/X86/AsmParser/X86AsmParser.cpp
1094 ${LLVM_DIR}/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
1095 ${LLVM_DIR}/lib/Target/X86/InstPrinter/X86InstComments.cpp
1096 ${LLVM_DIR}/lib/Target/X86/InstPrinter/X86InstPrinterCommon.cpp
1097 ${LLVM_DIR}/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp
1098 ${LLVM_DIR}/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
1099 ${LLVM_DIR}/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001100 ${LLVM_DIR}/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001101 ${LLVM_DIR}/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp
1102 ${LLVM_DIR}/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
1103 ${LLVM_DIR}/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001104 ${LLVM_DIR}/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp
1105 ${LLVM_DIR}/lib/Target/X86/MCTargetDesc/X86WinCOFFStreamer.cpp
1106 ${LLVM_DIR}/lib/Target/X86/MCTargetDesc/X86WinCOFFTargetStreamer.cpp
1107 ${LLVM_DIR}/lib/Target/X86/ShadowCallStack.cpp
1108 ${LLVM_DIR}/lib/Target/X86/TargetInfo/X86TargetInfo.cpp
1109 ${LLVM_DIR}/lib/Target/X86/Utils/X86ShuffleDecode.cpp
1110 ${LLVM_DIR}/lib/Target/X86/X86AsmPrinter.cpp
1111 ${LLVM_DIR}/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp
1112 ${LLVM_DIR}/lib/Target/X86/X86CallFrameOptimization.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001113 ${LLVM_DIR}/lib/Target/X86/X86CallingConv.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001114 ${LLVM_DIR}/lib/Target/X86/X86CallLowering.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001115 ${LLVM_DIR}/lib/Target/X86/X86CmovConversion.cpp
1116 ${LLVM_DIR}/lib/Target/X86/X86DomainReassignment.cpp
1117 ${LLVM_DIR}/lib/Target/X86/X86EvexToVex.cpp
1118 ${LLVM_DIR}/lib/Target/X86/X86ExpandPseudo.cpp
1119 ${LLVM_DIR}/lib/Target/X86/X86FastISel.cpp
1120 ${LLVM_DIR}/lib/Target/X86/X86FixupBWInsts.cpp
1121 ${LLVM_DIR}/lib/Target/X86/X86FixupLEAs.cpp
1122 ${LLVM_DIR}/lib/Target/X86/X86FixupSetCC.cpp
1123 ${LLVM_DIR}/lib/Target/X86/X86FlagsCopyLowering.cpp
1124 ${LLVM_DIR}/lib/Target/X86/X86FloatingPoint.cpp
1125 ${LLVM_DIR}/lib/Target/X86/X86FrameLowering.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001126 ${LLVM_DIR}/lib/Target/X86/X86IndirectBranchTracking.cpp
1127 ${LLVM_DIR}/lib/Target/X86/X86InstrFMA3Info.cpp
1128 ${LLVM_DIR}/lib/Target/X86/X86InstrFoldTables.cpp
1129 ${LLVM_DIR}/lib/Target/X86/X86InstrInfo.cpp
1130 ${LLVM_DIR}/lib/Target/X86/X86InstructionSelector.cpp
1131 ${LLVM_DIR}/lib/Target/X86/X86InterleavedAccess.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001132 ${LLVM_DIR}/lib/Target/X86/X86ISelDAGToDAG.cpp
1133 ${LLVM_DIR}/lib/Target/X86/X86ISelLowering.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001134 ${LLVM_DIR}/lib/Target/X86/X86LegalizerInfo.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001135 ${LLVM_DIR}/lib/Target/X86/X86MachineFunctionInfo.cpp
1136 ${LLVM_DIR}/lib/Target/X86/X86MacroFusion.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001137 ${LLVM_DIR}/lib/Target/X86/X86MCInstLower.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001138 ${LLVM_DIR}/lib/Target/X86/X86OptimizeLEAs.cpp
1139 ${LLVM_DIR}/lib/Target/X86/X86PadShortFunction.cpp
1140 ${LLVM_DIR}/lib/Target/X86/X86RegisterBankInfo.cpp
1141 ${LLVM_DIR}/lib/Target/X86/X86RegisterInfo.cpp
1142 ${LLVM_DIR}/lib/Target/X86/X86RetpolineThunks.cpp
1143 ${LLVM_DIR}/lib/Target/X86/X86SelectionDAGInfo.cpp
1144 ${LLVM_DIR}/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp
1145 ${LLVM_DIR}/lib/Target/X86/X86SpeculativeLoadHardening.cpp
1146 ${LLVM_DIR}/lib/Target/X86/X86Subtarget.cpp
1147 ${LLVM_DIR}/lib/Target/X86/X86TargetMachine.cpp
1148 ${LLVM_DIR}/lib/Target/X86/X86TargetObjectFile.cpp
1149 ${LLVM_DIR}/lib/Target/X86/X86TargetTransformInfo.cpp
1150 ${LLVM_DIR}/lib/Target/X86/X86VZeroUpper.cpp
1151 ${LLVM_DIR}/lib/Target/X86/X86WinAllocaExpander.cpp
1152 ${LLVM_DIR}/lib/Target/X86/X86WinEHState.cpp
1153 )
1154elseif(ARCH STREQUAL "mipsel" OR ARCH STREQUAL "mips64el")
1155 list(APPEND LLVM_LIST
1156 ${LLVM_DIR}/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
1157 ${LLVM_DIR}/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp
1158 ${LLVM_DIR}/lib/Target/Mips/MCTargetDesc/MipsABIFlagsSection.cpp
1159 ${LLVM_DIR}/lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp
1160 ${LLVM_DIR}/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001161 ${LLVM_DIR}/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001162 ${LLVM_DIR}/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp
1163 ${LLVM_DIR}/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
1164 ${LLVM_DIR}/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001165 ${LLVM_DIR}/lib/Target/Mips/MCTargetDesc/MipsMCExpr.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001166 ${LLVM_DIR}/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001167 ${LLVM_DIR}/lib/Target/Mips/MCTargetDesc/MipsNaClELFStreamer.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001168 ${LLVM_DIR}/lib/Target/Mips/MCTargetDesc/MipsOptionRecord.cpp
1169 ${LLVM_DIR}/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001170 ${LLVM_DIR}/lib/Target/Mips/MicroMipsSizeReduction.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001171 ${LLVM_DIR}/lib/Target/Mips/Mips16FrameLowering.cpp
1172 ${LLVM_DIR}/lib/Target/Mips/Mips16HardFloat.cpp
1173 ${LLVM_DIR}/lib/Target/Mips/Mips16HardFloatInfo.cpp
1174 ${LLVM_DIR}/lib/Target/Mips/Mips16InstrInfo.cpp
1175 ${LLVM_DIR}/lib/Target/Mips/Mips16ISelDAGToDAG.cpp
1176 ${LLVM_DIR}/lib/Target/Mips/Mips16ISelLowering.cpp
1177 ${LLVM_DIR}/lib/Target/Mips/Mips16RegisterInfo.cpp
1178 ${LLVM_DIR}/lib/Target/Mips/MipsAnalyzeImmediate.cpp
1179 ${LLVM_DIR}/lib/Target/Mips/MipsAsmPrinter.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001180 ${LLVM_DIR}/lib/Target/Mips/MipsBranchExpansion.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001181 ${LLVM_DIR}/lib/Target/Mips/MipsCallLowering.cpp
1182 ${LLVM_DIR}/lib/Target/Mips/MipsCCState.cpp
1183 ${LLVM_DIR}/lib/Target/Mips/MipsConstantIslandPass.cpp
1184 ${LLVM_DIR}/lib/Target/Mips/MipsDelaySlotFiller.cpp
1185 ${LLVM_DIR}/lib/Target/Mips/MipsExpandPseudo.cpp
1186 ${LLVM_DIR}/lib/Target/Mips/MipsFastISel.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001187 ${LLVM_DIR}/lib/Target/Mips/MipsFrameLowering.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001188 ${LLVM_DIR}/lib/Target/Mips/MipsInstrInfo.cpp
1189 ${LLVM_DIR}/lib/Target/Mips/MipsInstructionSelector.cpp
1190 ${LLVM_DIR}/lib/Target/Mips/MipsISelDAGToDAG.cpp
1191 ${LLVM_DIR}/lib/Target/Mips/MipsISelLowering.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001192 ${LLVM_DIR}/lib/Target/Mips/MipsLegalizerInfo.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001193 ${LLVM_DIR}/lib/Target/Mips/MipsMachineFunction.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001194 ${LLVM_DIR}/lib/Target/Mips/MipsMCInstLower.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001195 ${LLVM_DIR}/lib/Target/Mips/MipsModuleISelDAGToDAG.cpp
1196 ${LLVM_DIR}/lib/Target/Mips/MipsOptimizePICCall.cpp
1197 ${LLVM_DIR}/lib/Target/Mips/MipsOs16.cpp
1198 ${LLVM_DIR}/lib/Target/Mips/MipsRegisterBankInfo.cpp
1199 ${LLVM_DIR}/lib/Target/Mips/MipsRegisterInfo.cpp
1200 ${LLVM_DIR}/lib/Target/Mips/MipsSEFrameLowering.cpp
1201 ${LLVM_DIR}/lib/Target/Mips/MipsSEInstrInfo.cpp
1202 ${LLVM_DIR}/lib/Target/Mips/MipsSEISelDAGToDAG.cpp
1203 ${LLVM_DIR}/lib/Target/Mips/MipsSEISelLowering.cpp
1204 ${LLVM_DIR}/lib/Target/Mips/MipsSERegisterInfo.cpp
1205 ${LLVM_DIR}/lib/Target/Mips/MipsSubtarget.cpp
1206 ${LLVM_DIR}/lib/Target/Mips/MipsTargetMachine.cpp
1207 ${LLVM_DIR}/lib/Target/Mips/MipsTargetObjectFile.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001208 ${LLVM_DIR}/lib/Target/Mips/TargetInfo/MipsTargetInfo.cpp
1209 )
1210elseif(ARCH STREQUAL "aarch64")
1211 list(APPEND LLVM_LIST
Ben Clayton77d42cd2019-06-11 16:19:16 +01001212 ${LLVM_DIR}/lib/CodeGen/GlobalMerge.cpp
1213 ${LLVM_DIR}/lib/CodeGen/RegAllocPBQP.cpp
1214 ${LLVM_DIR}/lib/MC/ConstantPools.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001215 ${LLVM_DIR}/lib/Target/AArch64/AArch64A53Fix835769.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001216 ${LLVM_DIR}/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp
1217 ${LLVM_DIR}/lib/Target/AArch64/AArch64AdvSIMDScalarPass.cpp
1218 ${LLVM_DIR}/lib/Target/AArch64/AArch64AsmPrinter.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001219 ${LLVM_DIR}/lib/Target/AArch64/AArch64CallLowering.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001220 ${LLVM_DIR}/lib/Target/AArch64/AArch64CleanupLocalDynamicTLSPass.cpp
1221 ${LLVM_DIR}/lib/Target/AArch64/AArch64CollectLOH.cpp
1222 ${LLVM_DIR}/lib/Target/AArch64/AArch64CondBrTuning.cpp
1223 ${LLVM_DIR}/lib/Target/AArch64/AArch64ConditionalCompares.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001224 ${LLVM_DIR}/lib/Target/AArch64/AArch64ConditionOptimizer.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001225 ${LLVM_DIR}/lib/Target/AArch64/AArch64DeadRegisterDefinitionsPass.cpp
1226 ${LLVM_DIR}/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
1227 ${LLVM_DIR}/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp
1228 ${LLVM_DIR}/lib/Target/AArch64/AArch64FastISel.cpp
1229 ${LLVM_DIR}/lib/Target/AArch64/AArch64FrameLowering.cpp
1230 ${LLVM_DIR}/lib/Target/AArch64/AArch64InstrInfo.cpp
1231 ${LLVM_DIR}/lib/Target/AArch64/AArch64InstructionSelector.cpp
1232 ${LLVM_DIR}/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
1233 ${LLVM_DIR}/lib/Target/AArch64/AArch64ISelLowering.cpp
1234 ${LLVM_DIR}/lib/Target/AArch64/AArch64LegalizerInfo.cpp
1235 ${LLVM_DIR}/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
1236 ${LLVM_DIR}/lib/Target/AArch64/AArch64MacroFusion.cpp
1237 ${LLVM_DIR}/lib/Target/AArch64/AArch64MCInstLower.cpp
1238 ${LLVM_DIR}/lib/Target/AArch64/AArch64PBQPRegAlloc.cpp
1239 ${LLVM_DIR}/lib/Target/AArch64/AArch64PromoteConstant.cpp
1240 ${LLVM_DIR}/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp
1241 ${LLVM_DIR}/lib/Target/AArch64/AArch64RegisterBankInfo.cpp
1242 ${LLVM_DIR}/lib/Target/AArch64/AArch64RegisterInfo.cpp
1243 ${LLVM_DIR}/lib/Target/AArch64/AArch64SelectionDAGInfo.cpp
1244 ${LLVM_DIR}/lib/Target/AArch64/AArch64SIMDInstrOpt.cpp
1245 ${LLVM_DIR}/lib/Target/AArch64/AArch64StorePairSuppress.cpp
1246 ${LLVM_DIR}/lib/Target/AArch64/AArch64Subtarget.cpp
1247 ${LLVM_DIR}/lib/Target/AArch64/AArch64TargetMachine.cpp
1248 ${LLVM_DIR}/lib/Target/AArch64/AArch64TargetObjectFile.cpp
1249 ${LLVM_DIR}/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
1250 ${LLVM_DIR}/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001251 ${LLVM_DIR}/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp
1252 ${LLVM_DIR}/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001253 ${LLVM_DIR}/lib/Target/AArch64/InstPrinter/AArch64InstPrinter.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001254 ${LLVM_DIR}/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp
1255 ${LLVM_DIR}/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp
1256 ${LLVM_DIR}/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
1257 ${LLVM_DIR}/lib/Target/AArch64/MCTargetDesc/AArch64MachObjectWriter.cpp
1258 ${LLVM_DIR}/lib/Target/AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp
1259 ${LLVM_DIR}/lib/Target/AArch64/MCTargetDesc/AArch64MCCodeEmitter.cpp
1260 ${LLVM_DIR}/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.cpp
1261 ${LLVM_DIR}/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp
1262 ${LLVM_DIR}/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.cpp
1263 ${LLVM_DIR}/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFObjectWriter.cpp
1264 ${LLVM_DIR}/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp
1265 ${LLVM_DIR}/lib/Target/AArch64/TargetInfo/AArch64TargetInfo.cpp
1266 ${LLVM_DIR}/lib/Target/AArch64/Utils/AArch64BaseInfo.cpp
Ben Clayton77d42cd2019-06-11 16:19:16 +01001267 ${LLVM_DIR}/lib/Transforms/Scalar/LoopDataPrefetch.cpp
1268 ${LLVM_DIR}/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001269 )
1270elseif(ARCH STREQUAL "arm")
1271 list(APPEND LLVM_LIST
Ben Claytonc8740e02019-06-11 16:16:48 +01001272 ${LLVM_DIR}/lib/Target/ARM/A15SDOptimizer.cpp
1273 ${LLVM_DIR}/lib/Target/ARM/ARMAsmPrinter.cpp
1274 ${LLVM_DIR}/lib/Target/ARM/ARMBaseInstrInfo.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001275 ${LLVM_DIR}/lib/Target/ARM/ARMBaseRegisterInfo.cpp
1276 ${LLVM_DIR}/lib/Target/ARM/ARMCallLowering.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001277 ${LLVM_DIR}/lib/Target/ARM/ARMCodeGenPrepare.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001278 ${LLVM_DIR}/lib/Target/ARM/ARMComputeBlockSize.cpp
1279 ${LLVM_DIR}/lib/Target/ARM/ARMConstantIslandPass.cpp
1280 ${LLVM_DIR}/lib/Target/ARM/ARMConstantPoolValue.cpp
1281 ${LLVM_DIR}/lib/Target/ARM/ARMExpandPseudoInsts.cpp
1282 ${LLVM_DIR}/lib/Target/ARM/ARMFastISel.cpp
1283 ${LLVM_DIR}/lib/Target/ARM/ARMFrameLowering.cpp
1284 ${LLVM_DIR}/lib/Target/ARM/ARMHazardRecognizer.cpp
1285 ${LLVM_DIR}/lib/Target/ARM/ARMInstrInfo.cpp
1286 ${LLVM_DIR}/lib/Target/ARM/ARMInstructionSelector.cpp
1287 ${LLVM_DIR}/lib/Target/ARM/ARMISelDAGToDAG.cpp
1288 ${LLVM_DIR}/lib/Target/ARM/ARMISelLowering.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001289 ${LLVM_DIR}/lib/Target/ARM/ARMLegalizerInfo.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001290 ${LLVM_DIR}/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
1291 ${LLVM_DIR}/lib/Target/ARM/ARMMachineFunctionInfo.cpp
1292 ${LLVM_DIR}/lib/Target/ARM/ARMMacroFusion.cpp
1293 ${LLVM_DIR}/lib/Target/ARM/ARMMCInstLower.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001294 ${LLVM_DIR}/lib/Target/ARM/ARMOptimizeBarriersPass.cpp
Ben Claytonc8740e02019-06-11 16:16:48 +01001295 ${LLVM_DIR}/lib/Target/ARM/ARMParallelDSP.cpp
1296 ${LLVM_DIR}/lib/Target/ARM/ARMRegisterBankInfo.cpp
1297 ${LLVM_DIR}/lib/Target/ARM/ARMRegisterInfo.cpp
1298 ${LLVM_DIR}/lib/Target/ARM/ARMSelectionDAGInfo.cpp
1299 ${LLVM_DIR}/lib/Target/ARM/ARMSubtarget.cpp
1300 ${LLVM_DIR}/lib/Target/ARM/ARMTargetMachine.cpp
1301 ${LLVM_DIR}/lib/Target/ARM/ARMTargetObjectFile.cpp
1302 ${LLVM_DIR}/lib/Target/ARM/ARMTargetTransformInfo.cpp
1303 ${LLVM_DIR}/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
1304 ${LLVM_DIR}/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
1305 ${LLVM_DIR}/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
1306 ${LLVM_DIR}/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
1307 ${LLVM_DIR}/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
1308 ${LLVM_DIR}/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
1309 ${LLVM_DIR}/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp
1310 ${LLVM_DIR}/lib/Target/ARM/MCTargetDesc/ARMMachORelocationInfo.cpp
1311 ${LLVM_DIR}/lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp
1312 ${LLVM_DIR}/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp
1313 ${LLVM_DIR}/lib/Target/ARM/MCTargetDesc/ARMMCExpr.cpp
1314 ${LLVM_DIR}/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
1315 ${LLVM_DIR}/lib/Target/ARM/MCTargetDesc/ARMTargetStreamer.cpp
1316 ${LLVM_DIR}/lib/Target/ARM/MCTargetDesc/ARMUnwindOpAsm.cpp
1317 ${LLVM_DIR}/lib/Target/ARM/MCTargetDesc/ARMWinCOFFObjectWriter.cpp
1318 ${LLVM_DIR}/lib/Target/ARM/MCTargetDesc/ARMWinCOFFStreamer.cpp
1319 ${LLVM_DIR}/lib/Target/ARM/MLxExpansionPass.cpp
1320 ${LLVM_DIR}/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp
1321 ${LLVM_DIR}/lib/Target/ARM/Thumb1FrameLowering.cpp
1322 ${LLVM_DIR}/lib/Target/ARM/Thumb1InstrInfo.cpp
1323 ${LLVM_DIR}/lib/Target/ARM/Thumb2InstrInfo.cpp
1324 ${LLVM_DIR}/lib/Target/ARM/Thumb2ITBlockPass.cpp
1325 ${LLVM_DIR}/lib/Target/ARM/Thumb2SizeReduction.cpp
1326 ${LLVM_DIR}/lib/Target/ARM/ThumbRegisterInfo.cpp
1327 ${LLVM_DIR}/lib/Target/ARM/Utils/ARMBaseInfo.cpp
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001328 )
Colin Samplesf63a3ab2019-06-13 12:53:09 -04001329elseif(ARCH STREQUAL "ppc64le")
1330 list(APPEND LLVM_LIST
1331 ${LLVM_DIR}/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
1332 ${LLVM_DIR}/lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp
1333 ${LLVM_DIR}/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp
1334 ${LLVM_DIR}/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
1335 ${LLVM_DIR}/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp
1336 ${LLVM_DIR}/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp
1337 ${LLVM_DIR}/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp
1338 ${LLVM_DIR}/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp
1339 ${LLVM_DIR}/lib/Target/PowerPC/MCTargetDesc/PPCMCExpr.cpp
1340 ${LLVM_DIR}/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
1341 ${LLVM_DIR}/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp
1342 ${LLVM_DIR}/lib/Target/PowerPC/PPCAsmPrinter.cpp
1343 ${LLVM_DIR}/lib/Target/PowerPC/PPCBoolRetToInt.cpp
1344 ${LLVM_DIR}/lib/Target/PowerPC/PPCBranchCoalescing.cpp
1345 ${LLVM_DIR}/lib/Target/PowerPC/PPCBranchSelector.cpp
1346 ${LLVM_DIR}/lib/Target/PowerPC/PPCCCState.cpp
1347 ${LLVM_DIR}/lib/Target/PowerPC/PPCCTRLoops.cpp
1348 ${LLVM_DIR}/lib/Target/PowerPC/PPCEarlyReturn.cpp
1349 ${LLVM_DIR}/lib/Target/PowerPC/PPCExpandISEL.cpp
1350 ${LLVM_DIR}/lib/Target/PowerPC/PPCFastISel.cpp
1351 ${LLVM_DIR}/lib/Target/PowerPC/PPCFrameLowering.cpp
1352 ${LLVM_DIR}/lib/Target/PowerPC/PPCHazardRecognizers.cpp
1353 ${LLVM_DIR}/lib/Target/PowerPC/PPCInstrInfo.cpp
1354 ${LLVM_DIR}/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
1355 ${LLVM_DIR}/lib/Target/PowerPC/PPCISelLowering.cpp
1356 ${LLVM_DIR}/lib/Target/PowerPC/PPCLoopPreIncPrep.cpp
1357 ${LLVM_DIR}/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp
1358 ${LLVM_DIR}/lib/Target/PowerPC/PPCMCInstLower.cpp
1359 ${LLVM_DIR}/lib/Target/PowerPC/PPCMIPeephole.cpp
1360 ${LLVM_DIR}/lib/Target/PowerPC/PPCPreEmitPeephole.cpp
1361 ${LLVM_DIR}/lib/Target/PowerPC/PPCQPXLoadSplat.cpp
1362 ${LLVM_DIR}/lib/Target/PowerPC/PPCReduceCRLogicals.cpp
1363 ${LLVM_DIR}/lib/Target/PowerPC/PPCRegisterInfo.cpp
1364 ${LLVM_DIR}/lib/Target/PowerPC/PPCSubtarget.cpp
1365 ${LLVM_DIR}/lib/Target/PowerPC/PPCTargetMachine.cpp
1366 ${LLVM_DIR}/lib/Target/PowerPC/PPCTargetObjectFile.cpp
1367 ${LLVM_DIR}/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
1368 ${LLVM_DIR}/lib/Target/PowerPC/PPCTLSDynamicCall.cpp
1369 ${LLVM_DIR}/lib/Target/PowerPC/PPCTOCRegDeps.cpp
1370 ${LLVM_DIR}/lib/Target/PowerPC/PPCVSXCopy.cpp
1371 ${LLVM_DIR}/lib/Target/PowerPC/PPCVSXFMAMutate.cpp
1372 ${LLVM_DIR}/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp
1373 ${LLVM_DIR}/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp
1374 )
Ben Claytonac07ed82019-03-26 14:17:41 +00001375endif()
1376
1377if(REACTOR_EMIT_DEBUG_INFO)
1378 list(APPEND LLVM_LIST
1379 ${LLVM_DIR}/lib/Demangle/ItaniumDemangle.cpp
1380 )
1381endif(REACTOR_EMIT_DEBUG_INFO)
Nicolas Capens7d0b8a32018-10-30 16:36:52 -04001382
Logan Chien0eedc8c2018-08-21 09:34:28 +08001383set(LLVM_INCLUDE_DIR "")
1384
1385if(WIN32)
Nicolas Capensd7a21cc2018-09-11 13:09:28 -04001386 list(APPEND LLVM_INCLUDE_DIR ${LLVM_CONFIG_DIR}/windows/include)
Logan Chien0eedc8c2018-08-21 09:34:28 +08001387elseif(LINUX)
1388 list(APPEND LLVM_INCLUDE_DIR ${LLVM_CONFIG_DIR}/linux/include)
Ben Claytonac07ed82019-03-26 14:17:41 +00001389 list(APPEND LIBBACKTRACE_INCLUDE_DIR ${LIBBACKTRACE_CONFIG_DIR}/linux/include)
Logan Chien0eedc8c2018-08-21 09:34:28 +08001390elseif(APPLE)
Nicolas Capens2337f062018-10-30 13:49:46 -04001391 list(APPEND LLVM_INCLUDE_DIR ${LLVM_CONFIG_DIR}/darwin/include)
Ben Claytonac07ed82019-03-26 14:17:41 +00001392 list(APPEND LIBBACKTRACE_INCLUDE_DIR ${LIBBACKTRACE_CONFIG_DIR}/darwin/include)
Stephen Whitee6ab01f2019-04-04 14:31:25 -04001393elseif(ANDROID)
1394 list(APPEND LLVM_INCLUDE_DIR ${LLVM_CONFIG_DIR}/android/include)
Ben Claytonac07ed82019-03-26 14:17:41 +00001395 list(APPEND LIBBACKTRACE_INCLUDE_DIR ${LIBBACKTRACE_CONFIG_DIR}/android/include)
Logan Chien0eedc8c2018-08-21 09:34:28 +08001396endif()
1397
1398list(APPEND LLVM_INCLUDE_DIR
1399 ${LLVM_DIR}/include
Logan Chien009fecb2018-08-21 15:14:16 +08001400 ${LLVM_DIR}/lib/Target/AArch64
1401 ${LLVM_DIR}/lib/Target/ARM
Gordana Cmiljanovic082dfec2018-10-19 11:36:15 +02001402 ${LLVM_DIR}/lib/Target/Mips
Colin Samplesf63a3ab2019-06-13 12:53:09 -04001403 ${LLVM_DIR}/lib/Target/PowerPC
Logan Chien0eedc8c2018-08-21 09:34:28 +08001404 ${LLVM_DIR}/lib/Target/X86
1405 ${LLVM_CONFIG_DIR}/common/include
1406 ${LLVM_CONFIG_DIR}/common/lib/IR
Logan Chien009fecb2018-08-21 15:14:16 +08001407 ${LLVM_CONFIG_DIR}/common/lib/Target/AArch64
1408 ${LLVM_CONFIG_DIR}/common/lib/Target/ARM
Gordana Cmiljanovic082dfec2018-10-19 11:36:15 +02001409 ${LLVM_CONFIG_DIR}/common/lib/Target/Mips
Colin Samplesf63a3ab2019-06-13 12:53:09 -04001410 ${LLVM_CONFIG_DIR}/common/lib/Target/PowerPC
Logan Chien0eedc8c2018-08-21 09:34:28 +08001411 ${LLVM_CONFIG_DIR}/common/lib/Target/X86
1412 ${LLVM_CONFIG_DIR}/common/lib/Transforms/InstCombine
1413)
1414
Ben Clayton81be8c62019-02-26 16:50:31 +00001415# Suppress known LLVM warnings
Ben Clayton4ceb77d2019-04-24 12:09:59 +01001416set(LLVM_COMPILE_OPTIONS)
Ben Clayton81be8c62019-02-26 16:50:31 +00001417if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
Ben Clayton4ceb77d2019-04-24 12:09:59 +01001418 list(APPEND LLVM_COMPILE_OPTIONS
Ben Clayton81be8c62019-02-26 16:50:31 +00001419 "-Wno-noexcept-type" # mangled name for ‘X’ will change in C++17 because the exception specification is part of a function type
1420 "-Wno-maybe-uninitialized" # ‘X’ may be used uninitialized in this function
1421 "-Wno-unused-but-set-variable" # variable ‘X’ set but not used
1422 )
Nicolas Capens6d874f02019-06-26 10:31:47 -04001423 if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8)
1424 list(APPEND LLVM_COMPILE_OPTIONS
1425 "-Wno-class-memaccess" # memset/memcmp used on non-trivial class object
1426 )
1427 endif()
Ben Claytonedd7d412019-04-14 08:41:27 -04001428elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
Antonio Maiorano5bce1f42019-05-10 16:03:49 -04001429 list(APPEND LLVM_COMPILE_OPTIONS
Ben Claytonedd7d412019-04-14 08:41:27 -04001430 "/wd4141" # 'inline': used more than once
1431 "/wd4146" # unary minus operator applied to unsigned type, result still unsigned
1432 "/wd4244" # 'X': conversion from 'uint64_t' to 'const unsigned int', possible loss of data
1433 "/wd4267" # 'X': conversion from 'size_t' to 'unsigned int', possible loss of data
1434 "/wd4291" # 'void X new(size_t,unsigned int,unsigned int)': no matching operator delete found; memory will not be freed if initialization throws an exception
1435 "/wd4319" # 'X': zero extending 'unsigned int' to 'uint64_t' of greater size
1436 "/wd4624" # 'X': destructor was implicitly defined as deleted
1437 "/wd4805" # 'X': unsafe mix of type 'unsigned int' and type 'bool' in operation
1438 "/wd4996" # 'X': Call to 'Y' with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct.
1439 )
Ben Clayton81be8c62019-02-26 16:50:31 +00001440endif()
Ben Clayton81be8c62019-02-26 16:50:31 +00001441
Nicolas Capens5a105bc2015-12-22 22:04:28 -05001442add_library(llvm STATIC ${LLVM_LIST})
Corentin Wallez0866b292015-12-09 13:49:40 -05001443set_target_properties(llvm PROPERTIES
1444 POSITION_INDEPENDENT_CODE 1
1445 INCLUDE_DIRECTORIES "${LLVM_INCLUDE_DIR}"
Ben Clayton4ceb77d2019-04-24 12:09:59 +01001446 COMPILE_OPTIONS "${LLVM_COMPILE_OPTIONS}"
Nicolas Capensf53adbd2017-01-06 12:47:46 -05001447 COMPILE_DEFINITIONS "__STDC_CONSTANT_MACROS; __STDC_LIMIT_MACROS;"
Corentin Wallez0866b292015-12-09 13:49:40 -05001448 FOLDER "LLVM"
1449)
1450
Ben Clayton8f71f732019-02-01 09:38:45 +00001451# Add required libraries for LLVM
1452if(LINUX)
1453 target_link_libraries(llvm dl)
1454endif(LINUX)
1455
Corentin Wallez0866b292015-12-09 13:49:40 -05001456###########################################################
Nicolas Capensf53adbd2017-01-06 12:47:46 -05001457# Subzero
1458###########################################################
1459
Nicolas Capens26690ed2017-03-31 10:34:20 -04001460if(${REACTOR_BACKEND} STREQUAL "Subzero")
1461 set(SUBZERO_LIST
1462 ${SUBZERO_DIR}/src/IceAssembler.cpp
1463 ${SUBZERO_DIR}/src/IceCfg.cpp
1464 ${SUBZERO_DIR}/src/IceCfgNode.cpp
1465 ${SUBZERO_DIR}/src/IceClFlags.cpp
1466 ${SUBZERO_DIR}/src/IceELFObjectWriter.cpp
1467 ${SUBZERO_DIR}/src/IceELFSection.cpp
1468 ${SUBZERO_DIR}/src/IceFixups.cpp
1469 ${SUBZERO_DIR}/src/IceGlobalContext.cpp
1470 ${SUBZERO_DIR}/src/IceGlobalInits.cpp
1471 ${SUBZERO_DIR}/src/IceInst.cpp
1472 ${SUBZERO_DIR}/src/IceInstrumentation.cpp
1473 ${SUBZERO_DIR}/src/IceIntrinsics.cpp
1474 ${SUBZERO_DIR}/src/IceLiveness.cpp
1475 ${SUBZERO_DIR}/src/IceLoopAnalyzer.cpp
1476 ${SUBZERO_DIR}/src/IceMangling.cpp
1477 ${SUBZERO_DIR}/src/IceMemory.cpp
1478 ${SUBZERO_DIR}/src/IceOperand.cpp
1479 ${SUBZERO_DIR}/src/IceRangeSpec.cpp
1480 ${SUBZERO_DIR}/src/IceRegAlloc.cpp
1481 ${SUBZERO_DIR}/src/IceRevision.cpp
1482 ${SUBZERO_DIR}/src/IceRNG.cpp
1483 ${SUBZERO_DIR}/src/IceSwitchLowering.cpp
1484 ${SUBZERO_DIR}/src/IceTargetLowering.cpp
Nicolas Capens26690ed2017-03-31 10:34:20 -04001485 ${SUBZERO_DIR}/src/IceThreading.cpp
1486 ${SUBZERO_DIR}/src/IceTimerTree.cpp
1487 ${SUBZERO_DIR}/src/IceTypes.cpp
1488 ${SUBZERO_DIR}/src/IceVariableSplitting.cpp
Nicolas Capensf53adbd2017-01-06 12:47:46 -05001489 )
Nicolas Capens26690ed2017-03-31 10:34:20 -04001490
Nicolas Capens75753f92018-10-02 15:01:30 -04001491 # FIXME: Shouldn't depend on external source files directly.
1492 list(APPEND SUBZERO_LIST
1493 ${SOURCE_DIR}/Common/Memory.cpp
1494 )
1495
Nicolas Capens30cd7d42017-04-25 15:17:25 -04001496 if(ARCH STREQUAL "x86_64")
Nicolas Capens26690ed2017-03-31 10:34:20 -04001497 list(APPEND SUBZERO_LIST
Nicolas Capens30cd7d42017-04-25 15:17:25 -04001498 ${SUBZERO_DIR}/src/IceTargetLoweringX86.cpp
Nicolas Capens26690ed2017-03-31 10:34:20 -04001499 ${SUBZERO_DIR}/src/IceInstX8664.cpp
1500 ${SUBZERO_DIR}/src/IceTargetLoweringX8664.cpp
1501 )
1502 set(SUBZERO_TARGET X8664)
Nicolas Capens30cd7d42017-04-25 15:17:25 -04001503 elseif(ARCH STREQUAL "x86")
Nicolas Capens26690ed2017-03-31 10:34:20 -04001504 list(APPEND SUBZERO_LIST
Nicolas Capens30cd7d42017-04-25 15:17:25 -04001505 ${SUBZERO_DIR}/src/IceTargetLoweringX86.cpp
Nicolas Capens26690ed2017-03-31 10:34:20 -04001506 ${SUBZERO_DIR}/src/IceInstX8632.cpp
1507 ${SUBZERO_DIR}/src/IceTargetLoweringX8632.cpp
1508 )
1509 set(SUBZERO_TARGET X8632)
Nicolas Capens30cd7d42017-04-25 15:17:25 -04001510 elseif(ARCH STREQUAL "arm")
1511 list(APPEND SUBZERO_LIST
1512 ${SUBZERO_DIR}/src/IceAssemblerARM32.cpp
1513 ${SUBZERO_DIR}/src/IceInstARM32.cpp
1514 ${SUBZERO_DIR}/src/IceTargetLoweringARM32.cpp
1515 )
1516 set(SUBZERO_TARGET ARM32)
Gordana Cmiljanovic082dfec2018-10-19 11:36:15 +02001517 elseif(ARCH STREQUAL "mipsel")
1518 list(APPEND SUBZERO_LIST
1519 ${SUBZERO_DIR}/src/IceAssemblerMIPS32.cpp
1520 ${SUBZERO_DIR}/src/IceInstMIPS32.cpp
1521 ${SUBZERO_DIR}/src/IceTargetLoweringMIPS32.cpp
1522 )
1523 set(SUBZERO_TARGET MIPS32)
Nicolas Capens30cd7d42017-04-25 15:17:25 -04001524 else()
1525 message(FATAL_ERROR "Architecture '${ARCH}' not supported by Subzero")
Nicolas Capens26690ed2017-03-31 10:34:20 -04001526 endif()
1527
1528 file(GLOB_RECURSE SUBZERO_DEPENDENCIES_LIST
1529 ${SUBZERO_LLVM_DIR}/*.cpp
1530 ${SUBZERO_LLVM_DIR}/*.c
1531 ${SUBZERO_LLVM_DIR}/*.h
Nicolas Capensf53adbd2017-01-06 12:47:46 -05001532 )
Nicolas Capensf53adbd2017-01-06 12:47:46 -05001533
Nicolas Capens26690ed2017-03-31 10:34:20 -04001534 set(SUBZERO_REACTOR_LIST
Nicolas Capensb6d4ce32019-03-12 23:00:24 -04001535 ${SOURCE_DIR}/Reactor/Reactor.cpp
Antonio Maioranof448d8e2019-04-26 16:19:16 -04001536 ${SOURCE_DIR}/Reactor/Reactor.hpp
Nicolas Capens26690ed2017-03-31 10:34:20 -04001537 ${SOURCE_DIR}/Reactor/SubzeroReactor.cpp
Nicolas Capens26690ed2017-03-31 10:34:20 -04001538 ${SOURCE_DIR}/Reactor/Optimizer.cpp
1539 ${SOURCE_DIR}/Reactor/Nucleus.hpp
1540 ${SOURCE_DIR}/Reactor/Routine.hpp
Nicolas Capensc07dc4b2018-08-06 14:20:45 -04001541 ${SOURCE_DIR}/Reactor/Debug.cpp
1542 ${SOURCE_DIR}/Reactor/Debug.hpp
Nicolas Capens1a3ce872018-10-10 10:42:36 -04001543 ${SOURCE_DIR}/Reactor/ExecutableMemory.cpp
1544 ${SOURCE_DIR}/Reactor/ExecutableMemory.hpp
Nicolas Capens26690ed2017-03-31 10:34:20 -04001545 )
Nicolas Capensf53adbd2017-01-06 12:47:46 -05001546
Nicolas Capens26690ed2017-03-31 10:34:20 -04001547 set(SUBZERO_INCLUDE_DIR
1548 ${SUBZERO_DIR}/
1549 ${SUBZERO_LLVM_DIR}/include/
1550 ${SUBZERO_DIR}/pnacl-llvm/include/
Nicolas Capensc07dc4b2018-08-06 14:20:45 -04001551 )
Nicolas Capensf53adbd2017-01-06 12:47:46 -05001552
Nicolas Capens26690ed2017-03-31 10:34:20 -04001553 if(WIN32)
1554 list(APPEND SUBZERO_INCLUDE_DIR ${SUBZERO_LLVM_DIR}/build/Windows/include/)
1555 elseif(LINUX)
1556 list(APPEND SUBZERO_INCLUDE_DIR ${SUBZERO_LLVM_DIR}/build/Linux/include/)
1557 elseif(APPLE)
1558 list(APPEND SUBZERO_INCLUDE_DIR ${SUBZERO_LLVM_DIR}/build/MacOS/include/)
1559 endif()
Nicolas Capensf53adbd2017-01-06 12:47:46 -05001560
Antonio Maiorano5bce1f42019-05-10 16:03:49 -04001561 if(WIN32)
1562 list(APPEND SUBZERO_COMPILE_OPTIONS
1563 "/wd4334" # ''operator' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
1564 "/wd4996" # The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: new_name.
1565 )
1566 endif()
1567
Nicolas Capens26690ed2017-03-31 10:34:20 -04001568 add_library(ReactorSubzero STATIC
1569 ${SUBZERO_LIST}
1570 ${SUBZERO_DEPENDENCIES_LIST}
1571 ${SUBZERO_REACTOR_LIST}
1572 )
Nicolas Capens26690ed2017-03-31 10:34:20 -04001573 set_target_properties(ReactorSubzero PROPERTIES
1574 POSITION_INDEPENDENT_CODE 1
1575 INCLUDE_DIRECTORIES "${SUBZERO_INCLUDE_DIR}"
Antonio Maiorano5bce1f42019-05-10 16:03:49 -04001576 COMPILE_OPTIONS "${SUBZERO_COMPILE_OPTIONS};${SWIFTSHADER_COMPILE_OPTIONS}"
Nicolas Capens26690ed2017-03-31 10:34:20 -04001577 COMPILE_DEFINITIONS "SZTARGET=${SUBZERO_TARGET}; ALLOW_DUMP=0; ALLOW_TIMERS=0; ALLOW_LLVM_CL=0; ALLOW_LLVM_IR=0; ALLOW_LLVM_IR_AS_INPUT=0; ALLOW_MINIMAL_BUILD=0; ALLOW_WASM=0; ICE_THREAD_LOCAL_HACK=0;"
1578 FOLDER "Subzero"
1579 )
Nicolas Capensf53adbd2017-01-06 12:47:46 -05001580
Nicolas Capens26690ed2017-03-31 10:34:20 -04001581 if(WIN32)
1582 target_compile_definitions(ReactorSubzero PRIVATE SUBZERO_USE_MICROSOFT_ABI)
1583 endif()
Nicolas Capens19291ef2017-01-09 13:35:14 -05001584endif()
1585
Nicolas Capensf53adbd2017-01-06 12:47:46 -05001586###########################################################
Corentin Wallez0866b292015-12-09 13:49:40 -05001587# Include Directories
1588###########################################################
1589
1590set(COMMON_INCLUDE_DIR
1591 ${SOURCE_DIR}
Erwin Jansend46faeb2018-11-19 16:01:37 -08001592 ${CMAKE_CURRENT_SOURCE_DIR}/include
Corentin Wallez0866b292015-12-09 13:49:40 -05001593 ${LLVM_INCLUDE_DIR}
Ben Claytonac07ed82019-03-26 14:17:41 +00001594 ${LIBBACKTRACE_INCLUDE_DIR}
Corentin Wallez0866b292015-12-09 13:49:40 -05001595)
1596set(OPENGL_INCLUDE_DIR
1597 ${OPENGL_DIR}
Corentin Wallez0866b292015-12-09 13:49:40 -05001598 ${COMMON_INCLUDE_DIR}
1599)
1600
Chris Forbes3d27f2e2018-09-26 09:24:39 -07001601set(VULKAN_INCLUDE_DIR
Chris Forbes3d27f2e2018-09-26 09:24:39 -07001602 ${COMMON_INCLUDE_DIR}
1603)
1604
Corentin Wallez0866b292015-12-09 13:49:40 -05001605###########################################################
1606# File Lists
1607###########################################################
1608
1609file(GLOB_RECURSE SWIFTSHADER_LIST
1610 ${SOURCE_DIR}/Common/*.cpp
1611 ${SOURCE_DIR}/Common/*.h
1612 ${SOURCE_DIR}/Common/*.hpp
1613 ${SOURCE_DIR}/Renderer/*.cpp
1614 ${SOURCE_DIR}/Renderer/*.h
1615 ${SOURCE_DIR}/Renderer/*.hpp
1616 ${SOURCE_DIR}/Shader/*.cpp
1617 ${SOURCE_DIR}/Shader/*.h
1618 ${SOURCE_DIR}/Shader/*.hpp
1619)
1620list(APPEND SWIFTSHADER_LIST
1621 ${SOURCE_DIR}/Main/Config.cpp
1622 ${SOURCE_DIR}/Main/Config.hpp
Corentin Wallez0866b292015-12-09 13:49:40 -05001623 ${SOURCE_DIR}/Main/FrameBuffer.cpp
1624 ${SOURCE_DIR}/Main/FrameBuffer.hpp
Corentin Wallez0866b292015-12-09 13:49:40 -05001625 ${SOURCE_DIR}/Main/SwiftConfig.cpp
1626 ${SOURCE_DIR}/Main/SwiftConfig.hpp
1627)
1628list(REMOVE_ITEM SWIFTSHADER_LIST
1629 ${SOURCE_DIR}/Common/DebugAndroid.cpp
1630 ${SOURCE_DIR}/Common/DebugAndroid.hpp
1631 ${SOURCE_DIR}/Common/GrallocAndroid.cpp
1632 ${SOURCE_DIR}/Common/GrallocAndroid.hpp
1633)
1634
Ben Claytonac07ed82019-03-26 14:17:41 +00001635if(REACTOR_EMIT_DEBUG_INFO)
1636 set(LIBBACKTRACE_LIST
1637 ${LIBBACKTRACE_DIR}/atomic.c
1638 ${LIBBACKTRACE_DIR}/backtrace.c
1639 ${LIBBACKTRACE_DIR}/backtrace.h
1640 ${LIBBACKTRACE_DIR}/dwarf.c
1641 ${LIBBACKTRACE_DIR}/fileline.c
1642 ${LIBBACKTRACE_DIR}/filenames.h
1643 ${LIBBACKTRACE_DIR}/internal.h
1644 ${LIBBACKTRACE_DIR}/mmap.c
1645 ${LIBBACKTRACE_DIR}/mmapio.c
1646 ${LIBBACKTRACE_DIR}/posix.c
1647 ${LIBBACKTRACE_DIR}/print.c
1648 ${LIBBACKTRACE_DIR}/simple.c
1649 ${LIBBACKTRACE_DIR}/sort.c
1650 ${LIBBACKTRACE_DIR}/state.c
1651 ${LIBBACKTRACE_INCLUDE_DIR}/backtrace-supported.h
1652 ${LIBBACKTRACE_INCLUDE_DIR}/config.h
1653 )
1654
1655 if(WIN32)
1656 list(APPEND LIBBACKTRACE_LIST ${LIBBACKTRACE_DIR}/pecoff.c)
1657 elseif(LINUX)
1658 list(APPEND LIBBACKTRACE_LIST ${LIBBACKTRACE_DIR}/elf.c)
1659 elseif(APPLE)
1660 message(FATAL_ERROR "libbacktrace does not support mach-o yet")
1661 endif()
1662endif(REACTOR_EMIT_DEBUG_INFO)
1663
Nicolas Capensf53adbd2017-01-06 12:47:46 -05001664set(REACTOR_LLVM_LIST
Nicolas Capensb6d4ce32019-03-12 23:00:24 -04001665 ${SOURCE_DIR}/Reactor/Reactor.cpp
Antonio Maioranof448d8e2019-04-26 16:19:16 -04001666 ${SOURCE_DIR}/Reactor/Reactor.hpp
Nicolas Capens5763d172016-09-26 13:44:20 -04001667 ${SOURCE_DIR}/Reactor/LLVMReactor.cpp
Ben Claytonac07ed82019-03-26 14:17:41 +00001668 ${SOURCE_DIR}/Reactor/LLVMReactor.hpp
1669 ${SOURCE_DIR}/Reactor/LLVMReactorDebugInfo.cpp
1670 ${SOURCE_DIR}/Reactor/LLVMReactorDebugInfo.hpp
Corentin Wallez0866b292015-12-09 13:49:40 -05001671 ${SOURCE_DIR}/Reactor/Nucleus.hpp
Corentin Wallez0866b292015-12-09 13:49:40 -05001672 ${SOURCE_DIR}/Reactor/Routine.hpp
Nicolas Capensc07dc4b2018-08-06 14:20:45 -04001673 ${SOURCE_DIR}/Reactor/CPUID.cpp
1674 ${SOURCE_DIR}/Reactor/CPUID.hpp
1675 ${SOURCE_DIR}/Reactor/Debug.cpp
1676 ${SOURCE_DIR}/Reactor/Debug.hpp
Nicolas Capens1a3ce872018-10-10 10:42:36 -04001677 ${SOURCE_DIR}/Reactor/ExecutableMemory.cpp
1678 ${SOURCE_DIR}/Reactor/ExecutableMemory.hpp
Corentin Wallez0866b292015-12-09 13:49:40 -05001679)
1680
1681file(GLOB_RECURSE EGL_LIST
1682 ${OPENGL_DIR}/libEGL/*.cpp
1683 ${OPENGL_DIR}/libEGL/*.h
1684 ${OPENGL_DIR}/libEGL/*.hpp
1685 ${OPENGL_DIR}/common/Object.cpp
1686 ${OPENGL_DIR}/common/Object.hpp
1687 ${OPENGL_DIR}/common/debug.cpp
1688 ${OPENGL_DIR}/common/debug.h
Chris Forbesf8374cf2018-12-06 13:25:59 -08001689 ${SOURCE_DIR}/Common/SharedLibrary.cpp
1690 ${SOURCE_DIR}/Common/SharedLibrary.hpp
Erwin Jansend46faeb2018-11-19 16:01:37 -08001691 ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h
Corentin Wallez0866b292015-12-09 13:49:40 -05001692)
1693
Corentin Wallez0866b292015-12-09 13:49:40 -05001694file(GLOB_RECURSE GLES2_LIST
1695 ${OPENGL_DIR}/libGLESv2/*.cpp
1696 ${OPENGL_DIR}/libGLESv2/*.h
1697 ${OPENGL_DIR}/libGLESv2/*.hpp
Nicolas Capens681d97b2016-05-17 16:02:32 -04001698 ${OPENGL_DIR}/common/*.cpp
1699 ${OPENGL_DIR}/common/*.h
1700 ${OPENGL_DIR}/common/*.hpp
Chris Forbesf8374cf2018-12-06 13:25:59 -08001701 ${SOURCE_DIR}/Common/SharedLibrary.cpp
1702 ${SOURCE_DIR}/Common/SharedLibrary.hpp
Erwin Jansend46faeb2018-11-19 16:01:37 -08001703 ${CMAKE_CURRENT_SOURCE_DIR}/include/KHR/*.h
1704 ${CMAKE_CURRENT_SOURCE_DIR}/include/GLES2/*.h
1705 ${CMAKE_CURRENT_SOURCE_DIR}/include/GLES3/*.h
Corentin Wallez0866b292015-12-09 13:49:40 -05001706)
1707
1708file(GLOB_RECURSE GLES_CM_LIST
1709 ${OPENGL_DIR}/libGLES_CM/*.cpp
1710 ${OPENGL_DIR}/libGLES_CM/*.h
1711 ${OPENGL_DIR}/libGLES_CM/*.hpp
Nicolas Capens681d97b2016-05-17 16:02:32 -04001712 ${OPENGL_DIR}/common/*.cpp
1713 ${OPENGL_DIR}/common/*.h
1714 ${OPENGL_DIR}/common/*.hpp
Chris Forbesf8374cf2018-12-06 13:25:59 -08001715 ${SOURCE_DIR}/Common/SharedLibrary.cpp
1716 ${SOURCE_DIR}/Common/SharedLibrary.hpp
Erwin Jansend46faeb2018-11-19 16:01:37 -08001717 ${CMAKE_CURRENT_SOURCE_DIR}/include/KHR/*.h
1718 ${CMAKE_CURRENT_SOURCE_DIR}/include/GLES/*.h
Corentin Wallez0866b292015-12-09 13:49:40 -05001719)
1720
1721file(GLOB_RECURSE OPENGL_COMPILER_LIST
1722 ${OPENGL_COMPILER_DIR}/*.cpp
1723 ${OPENGL_COMPILER_DIR}/*.h
1724 ${OPENGL_COMPILER_DIR}/*.hpp
1725)
1726file(GLOB_RECURSE OPENGL_COMPILER_OS_SPECIFIC_LIST
1727 ${OPENGL_COMPILER_DIR}/ossource*.cpp
1728 ${OPENGL_COMPILER_DIR}/ossource*.h
1729 ${OPENGL_COMPILER_DIR}/ossource*.hpp
1730)
1731list(REMOVE_ITEM OPENGL_COMPILER_LIST ${OPENGL_COMPILER_OS_SPECIFIC_LIST})
1732
Chris Forbes3d27f2e2018-09-26 09:24:39 -07001733file(GLOB_RECURSE VULKAN_LIST
1734 ${VULKAN_DIR}/*.cpp
1735 ${VULKAN_DIR}/*.h
Alexis Hetue70c3512018-10-17 13:18:04 -04001736 ${VULKAN_DIR}/*.hpp
Alexis Hetuc0f92f22018-11-15 16:25:38 -05001737 ${SOURCE_DIR}/System/CPUID.cpp
1738 ${SOURCE_DIR}/System/CPUID.hpp
1739 ${SOURCE_DIR}/System/Configurator.cpp
1740 ${SOURCE_DIR}/System/Configurator.hpp
Chris Forbesc730c382018-12-05 16:48:33 -08001741 ${SOURCE_DIR}/System/Debug.cpp
1742 ${SOURCE_DIR}/System/Debug.hpp
Alexis Hetuc0f92f22018-11-15 16:25:38 -05001743 ${SOURCE_DIR}/System/Half.cpp
1744 ${SOURCE_DIR}/System/Half.hpp
1745 ${SOURCE_DIR}/System/Math.cpp
1746 ${SOURCE_DIR}/System/Math.hpp
1747 ${SOURCE_DIR}/System/Memory.cpp
1748 ${SOURCE_DIR}/System/Memory.hpp
Alexis Hetuc0f92f22018-11-15 16:25:38 -05001749 ${SOURCE_DIR}/System/Socket.cpp
1750 ${SOURCE_DIR}/System/Socket.hpp
Ben Claytoned01f2c2019-05-20 10:42:35 +01001751 ${SOURCE_DIR}/System/Synchronization.hpp
Alexis Hetuc0f92f22018-11-15 16:25:38 -05001752 ${SOURCE_DIR}/System/Timer.cpp
1753 ${SOURCE_DIR}/System/Timer.hpp
1754 ${SOURCE_DIR}/Device/*.cpp
1755 ${SOURCE_DIR}/Device/*.hpp
1756 ${SOURCE_DIR}/Pipeline/*.cpp
1757 ${SOURCE_DIR}/Pipeline/*.hpp
Hernan Liatisc6eb41b2019-02-22 11:12:59 -08001758 ${SOURCE_DIR}/WSI/VkSurfaceKHR.cpp
1759 ${SOURCE_DIR}/WSI/VkSurfaceKHR.hpp
Hernan Liatisc7943e92019-02-25 19:29:54 -08001760 ${SOURCE_DIR}/WSI/VkSwapchainKHR.cpp
1761 ${SOURCE_DIR}/WSI/VkSwapchainKHR.hpp
Erwin Jansend46faeb2018-11-19 16:01:37 -08001762 ${CMAKE_CURRENT_SOURCE_DIR}/include/vulkan/*.h}
Chris Forbes3d27f2e2018-09-26 09:24:39 -07001763)
1764
Corentin Wallez0866b292015-12-09 13:49:40 -05001765###########################################################
1766# Append OS specific files to lists
1767###########################################################
1768
1769if(WIN32)
1770 list(APPEND SWIFTSHADER_LIST
1771 ${SOURCE_DIR}/Main/FrameBufferDD.cpp
1772 ${SOURCE_DIR}/Main/FrameBufferDD.hpp
1773 ${SOURCE_DIR}/Main/FrameBufferGDI.cpp
1774 ${SOURCE_DIR}/Main/FrameBufferGDI.hpp
1775 ${SOURCE_DIR}/Main/FrameBufferWin.cpp
1776 ${SOURCE_DIR}/Main/FrameBufferWin.hpp
Corentin Wallez0866b292015-12-09 13:49:40 -05001777 )
1778 list(APPEND OPENGL_COMPILER_LIST ${OPENGL_COMPILER_DIR}/ossource_win.cpp)
1779 list(APPEND EGL_LIST ${OPENGL_DIR}/libEGL/libEGL.rc)
Corentin Wallez0866b292015-12-09 13:49:40 -05001780 list(APPEND GLES2_LIST ${OPENGL_DIR}/libGLESv2/libGLESv2.rc)
1781 list(APPEND GLES_CM_LIST ${OPENGL_DIR}/libGLES_CM/libGLES_CM.rc)
1782elseif(LINUX)
1783 list(APPEND SWIFTSHADER_LIST
1784 ${SOURCE_DIR}/Main/FrameBufferX11.cpp
1785 ${SOURCE_DIR}/Main/FrameBufferX11.hpp
Nicolas Capens681d97b2016-05-17 16:02:32 -04001786 ${SOURCE_DIR}/Common/SharedLibrary.hpp
1787 ${SOURCE_DIR}/Main/libX11.cpp
1788 ${SOURCE_DIR}/Main/libX11.hpp
1789 )
1790 list(APPEND EGL_LIST
1791 ${SOURCE_DIR}/Common/SharedLibrary.hpp
Corentin Wallez0866b292015-12-09 13:49:40 -05001792 ${SOURCE_DIR}/Main/libX11.cpp
1793 ${SOURCE_DIR}/Main/libX11.hpp
1794 )
1795 list(APPEND OPENGL_COMPILER_LIST
1796 ${OPENGL_COMPILER_DIR}/ossource_posix.cpp
1797 )
Hernan Liatisc6eb41b2019-02-22 11:12:59 -08001798
1799 list(APPEND VULKAN_LIST
1800 ${SOURCE_DIR}/WSI/libX11.cpp
1801 ${SOURCE_DIR}/WSI/libX11.hpp
1802 ${SOURCE_DIR}/WSI/XlibSurfaceKHR.cpp
1803 ${SOURCE_DIR}/WSI/XlibSurfaceKHR.hpp
1804 )
Corentin Wallez27654c22015-12-09 15:22:08 -05001805elseif(APPLE)
1806 list(APPEND SWIFTSHADER_LIST
1807 ${SOURCE_DIR}/Main/FrameBufferOSX.mm
1808 ${SOURCE_DIR}/Main/FrameBufferOSX.hpp
1809 )
Corentin Wallezcd0a4572015-12-10 15:59:28 -05001810 list(APPEND EGL_LIST
1811 ${OPENGL_DIR}/libEGL/OSXUtils.mm
1812 ${OPENGL_DIR}/libEGL/OSXUtils.hpp
1813 )
Corentin Wallez27654c22015-12-09 15:22:08 -05001814 list(APPEND OPENGL_COMPILER_LIST
1815 ${OPENGL_COMPILER_DIR}/ossource_posix.cpp
1816 )
Alexis Hetu0662a4a2019-07-08 15:06:40 -04001817
1818 list(APPEND VULKAN_LIST
1819 ${SOURCE_DIR}/WSI/MacOSSurfaceMVK.mm
1820 ${SOURCE_DIR}/WSI/MacOSSurfaceMVK.h
1821 )
Stephen Whitee6ab01f2019-04-04 14:31:25 -04001822elseif(ANDROID)
1823 list(APPEND SWIFTSHADER_LIST
1824 ${SOURCE_DIR}/Main/FrameBufferAndroid.cpp
1825 ${SOURCE_DIR}/Main/FrameBufferAndroid.hpp
1826 )
1827 list(APPEND OPENGL_COMPILER_LIST
1828 ${OPENGL_COMPILER_DIR}/ossource_posix.cpp
1829 )
Corentin Wallez0866b292015-12-09 13:49:40 -05001830endif()
1831
1832if(WIN32)
1833 set(OS_LIBS odbc32 odbccp32 WS2_32 dxguid)
1834elseif(LINUX)
Nicolas Capens681d97b2016-05-17 16:02:32 -04001835 set(OS_LIBS dl pthread)
Corentin Wallezcd0a4572015-12-10 15:59:28 -05001836elseif(APPLE)
1837 find_library(COCOA_FRAMEWORK Cocoa)
1838 find_library(QUARTZ_FRAMEWORK Quartz)
Alexis Hetud23cf632018-04-10 10:48:42 -04001839 find_library(CORE_FOUNDATION_FRAMEWORK CoreFoundation)
1840 find_library(IOSURFACE_FRAMEWORK IOSurface)
1841 set(OS_LIBS "${COCOA_FRAMEWORK}" "${QUARTZ_FRAMEWORK}" "${CORE_FOUNDATION_FRAMEWORK}" "${IOSURFACE_FRAMEWORK}")
Corentin Wallez0866b292015-12-09 13:49:40 -05001842endif()
1843
1844###########################################################
Nicolas Capens5a105bc2015-12-22 22:04:28 -05001845# SwiftShader Targets
Corentin Wallez0866b292015-12-09 13:49:40 -05001846###########################################################
1847
1848add_library(SwiftShader STATIC ${SWIFTSHADER_LIST})
1849set_target_properties(SwiftShader PROPERTIES
1850 INCLUDE_DIRECTORIES "${COMMON_INCLUDE_DIR}"
1851 POSITION_INDEPENDENT_CODE 1
1852 FOLDER "Core"
Ben Clayton4ceb77d2019-04-24 12:09:59 +01001853 COMPILE_OPTIONS "${SWIFTSHADER_COMPILE_OPTIONS}"
Nicolas Capens506cc5e2017-07-24 11:30:55 -04001854 COMPILE_DEFINITIONS "NO_SANITIZE_FUNCTION=;"
Corentin Wallez0866b292015-12-09 13:49:40 -05001855)
1856target_link_libraries(SwiftShader ${OS_LIBS})
1857
Ben Claytonb99bc1f2019-04-15 13:56:08 -04001858if(${REACTOR_BACKEND} STREQUAL "LLVM")
1859 add_library(ReactorLLVM STATIC ${REACTOR_LLVM_LIST})
1860 set_target_properties(ReactorLLVM PROPERTIES
1861 INCLUDE_DIRECTORIES "${COMMON_INCLUDE_DIR}"
Ben Claytonac07ed82019-03-26 14:17:41 +00001862 POSITION_INDEPENDENT_CODE 1
1863 FOLDER "Core"
Ben Clayton09a7f452019-04-25 15:22:43 +01001864 COMPILE_OPTIONS "${SWIFTSHADER_COMPILE_OPTIONS}"
Ben Claytonac07ed82019-03-26 14:17:41 +00001865 )
Ben Claytonb99bc1f2019-04-15 13:56:08 -04001866 target_link_libraries(ReactorLLVM llvm ${OS_LIBS})
Ben Claytonac07ed82019-03-26 14:17:41 +00001867
Ben Claytonb99bc1f2019-04-15 13:56:08 -04001868 if(REACTOR_EMIT_DEBUG_INFO)
Antonio Maioranof448d8e2019-04-26 16:19:16 -04001869 if(WIN32)
1870 # Boost stacktrace uses COM on Windows.
1871 # On Windows, cache COM instances in TLS for performance.
Antonio Maiorano8b321d12019-05-27 16:15:34 -04001872 target_compile_definitions(ReactorLLVM PRIVATE BOOST_STACKTRACE_USE_WINDBG_CACHED)
Antonio Maioranof448d8e2019-04-26 16:19:16 -04001873 else()
1874 # Boost stacktrace uses libbacktrace
Antonio Maiorano8b321d12019-05-27 16:15:34 -04001875 target_compile_definitions(ReactorLLVM PRIVATE BOOST_STACKTRACE_USE_BACKTRACE)
Antonio Maioranof448d8e2019-04-26 16:19:16 -04001876
1877 # Boost stacktrace uses exceptions, so force enable it
1878 set_cpp_flag("-fexceptions")
1879
1880 add_library(Libbacktrace STATIC ${LIBBACKTRACE_LIST})
1881 set_target_properties(Libbacktrace PROPERTIES
1882 INCLUDE_DIRECTORIES "${LIBBACKTRACE_INCLUDE_DIR}"
1883 POSITION_INDEPENDENT_CODE 1
1884 FOLDER "Core"
1885 )
1886 target_link_libraries(Libbacktrace ${OS_LIBS})
1887 target_link_libraries(ReactorLLVM Libbacktrace)
1888 endif()
Antonio Maiorano8b321d12019-05-27 16:15:34 -04001889
1890 # Download boost and use it
1891 DownloadBoost()
1892 set(BOOST_INCLUDEDIR ${BOOST_THIRD_PARTY_DIR})
1893 find_package(Boost REQUIRED)
1894 target_link_libraries(ReactorLLVM Boost::boost)
1895
Ben Claytonb99bc1f2019-04-15 13:56:08 -04001896 endif(REACTOR_EMIT_DEBUG_INFO)
1897
Nicolas Capensf53adbd2017-01-06 12:47:46 -05001898 set(Reactor ReactorLLVM)
1899elseif(${REACTOR_BACKEND} STREQUAL "Subzero")
1900 set(Reactor ReactorSubzero)
1901else()
1902 message(FATAL_ERROR "REACTOR_BACKEND must be 'LLVM' or 'Subzero'")
1903endif()
Corentin Wallez0866b292015-12-09 13:49:40 -05001904
Corentin Wallez0866b292015-12-09 13:49:40 -05001905add_library(GLCompiler STATIC ${OPENGL_COMPILER_LIST})
1906set_target_properties(GLCompiler PROPERTIES
1907 INCLUDE_DIRECTORIES "${OPENGL_INCLUDE_DIR}"
1908 POSITION_INDEPENDENT_CODE 1
1909 FOLDER "OpenGL"
Ben Clayton4ceb77d2019-04-24 12:09:59 +01001910 COMPILE_OPTIONS "${SWIFTSHADER_COMPILE_OPTIONS}"
Corentin Wallez0866b292015-12-09 13:49:40 -05001911)
1912target_link_libraries(GLCompiler ${OS_LIBS})
1913
Nicolas Capens6f422092015-12-23 15:12:45 -05001914if(CMAKE_SIZEOF_VOID_P EQUAL 8)
1915 set(LIB_PREFIX "lib64")
1916else()
1917 set(LIB_PREFIX "lib")
1918endif()
1919
Corentin Wallez0866b292015-12-09 13:49:40 -05001920if(BUILD_EGL)
1921 add_library(libEGL SHARED ${EGL_LIST})
1922 set_target_properties(libEGL PROPERTIES
1923 INCLUDE_DIRECTORIES "${OPENGL_INCLUDE_DIR}"
1924 FOLDER "OpenGL"
Ben Clayton4ceb77d2019-04-24 12:09:59 +01001925 COMPILE_OPTIONS "${SWIFTSHADER_COMPILE_OPTIONS}"
Antonio Maioranob0a68ed2019-04-26 15:34:22 -04001926 COMPILE_DEFINITIONS "EGL_EGLEXT_PROTOTYPES; EGLAPI=; NO_SANITIZE_FUNCTION=;$<$<CONFIG:Debug>:DEBUGGER_WAIT_DIALOG>"
Corentin Wallez0866b292015-12-09 13:49:40 -05001927 PREFIX ""
1928 )
Stephen Whitee6ab01f2019-04-04 14:31:25 -04001929 if (ANDROID)
1930 set_target_properties(libEGL PROPERTIES SUFFIX "_swiftshader.so")
1931 endif ()
Nicolas Capens499bb762018-06-29 13:30:57 -04001932 set_shared_library_export_map(libEGL ${SOURCE_DIR}/OpenGL/libEGL)
Corentin Wallez0866b292015-12-09 13:49:40 -05001933 target_link_libraries(libEGL ${OS_LIBS})
Nicolas Capens6f422092015-12-23 15:12:45 -05001934 add_custom_command(
1935 TARGET libEGL
1936 POST_BUILD
1937 COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:libEGL>/translator
1938 COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:libEGL> $<TARGET_FILE_DIR:libEGL>/translator/${LIB_PREFIX}EGL_translator${CMAKE_SHARED_LIBRARY_SUFFIX}
Dan Sinclair1b8cd2d2019-03-14 10:51:05 -04001939 COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/${CMAKE_SYSTEM_NAME}/
1940 COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:libEGL> ${CMAKE_BINARY_DIR}/${CMAKE_SYSTEM_NAME}/
Nicolas Capens6f422092015-12-23 15:12:45 -05001941 )
Corentin Wallez0866b292015-12-09 13:49:40 -05001942endif()
1943
Corentin Wallez0866b292015-12-09 13:49:40 -05001944if(BUILD_GLESv2)
1945 add_library(libGLESv2 SHARED ${GLES2_LIST})
1946 set_target_properties(libGLESv2 PROPERTIES
1947 INCLUDE_DIRECTORIES "${OPENGL_INCLUDE_DIR}"
1948 FOLDER "OpenGL"
Ben Clayton4ceb77d2019-04-24 12:09:59 +01001949 COMPILE_OPTIONS "${SWIFTSHADER_COMPILE_OPTIONS}"
Nicolas Capens8e6ed2e2018-05-31 16:21:02 -04001950 COMPILE_DEFINITIONS "GL_GLEXT_PROTOTYPES; GL_API=; GL_APICALL=; GLAPI=; NO_SANITIZE_FUNCTION=;"
Corentin Wallez0866b292015-12-09 13:49:40 -05001951 PREFIX ""
1952 )
Stephen Whitee6ab01f2019-04-04 14:31:25 -04001953 if (ANDROID)
1954 set_target_properties(libGLESv2 PROPERTIES SUFFIX "_swiftshader.so")
1955 endif ()
Nicolas Capens499bb762018-06-29 13:30:57 -04001956 set_shared_library_export_map(libGLESv2 ${SOURCE_DIR}/OpenGL/libGLESv2)
Nicolas Capensf53adbd2017-01-06 12:47:46 -05001957 target_link_libraries(libGLESv2 SwiftShader ${Reactor} GLCompiler ${OS_LIBS})
Nicolas Capens6f422092015-12-23 15:12:45 -05001958 add_custom_command(
1959 TARGET libGLESv2
1960 POST_BUILD
1961 COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:libGLESv2>/translator
1962 COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:libGLESv2> $<TARGET_FILE_DIR:libGLESv2>/translator/${LIB_PREFIX}GLES_V2_translator${CMAKE_SHARED_LIBRARY_SUFFIX}
Dan Sinclair1b8cd2d2019-03-14 10:51:05 -04001963 COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/${CMAKE_SYSTEM_NAME}/
1964 COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:libGLESv2> ${CMAKE_BINARY_DIR}/${CMAKE_SYSTEM_NAME}/
Nicolas Capens6f422092015-12-23 15:12:45 -05001965 )
Corentin Wallez0866b292015-12-09 13:49:40 -05001966endif()
1967
1968if(BUILD_GLES_CM)
1969 add_library(libGLES_CM SHARED ${GLES_CM_LIST})
1970 set_target_properties(libGLES_CM PROPERTIES
1971 INCLUDE_DIRECTORIES "${OPENGL_INCLUDE_DIR}"
1972 FOLDER "OpenGL"
Ben Clayton4ceb77d2019-04-24 12:09:59 +01001973 COMPILE_OPTIONS "${SWIFTSHADER_COMPILE_OPTIONS}"
Nicolas Capens8e6ed2e2018-05-31 16:21:02 -04001974 COMPILE_DEFINITIONS "GL_GLEXT_PROTOTYPES; EGLAPI=; GL_API=; GL_APICALL=; GLAPI=;"
Corentin Wallez0866b292015-12-09 13:49:40 -05001975 PREFIX ""
1976 )
Stephen Whitee6ab01f2019-04-04 14:31:25 -04001977 if (ANDROID)
1978 set_target_properties(libGLES_CM PROPERTIES SUFFIX "_swiftshader.so")
1979 endif ()
Nicolas Capens499bb762018-06-29 13:30:57 -04001980 set_shared_library_export_map(libGLES_CM ${SOURCE_DIR}/OpenGL/libGLES_CM)
Nicolas Capensf53adbd2017-01-06 12:47:46 -05001981 target_link_libraries(libGLES_CM SwiftShader ${Reactor} GLCompiler ${OS_LIBS})
Nicolas Capens6f422092015-12-23 15:12:45 -05001982 add_custom_command(
1983 TARGET libGLES_CM
1984 POST_BUILD
1985 COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:libGLES_CM>/translator
1986 COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:libGLES_CM> $<TARGET_FILE_DIR:libGLES_CM>/translator/${LIB_PREFIX}GLES_CM_translator${CMAKE_SHARED_LIBRARY_SUFFIX}
1987 )
Corentin Wallez0866b292015-12-09 13:49:40 -05001988endif()
1989
Chris Forbes3d27f2e2018-09-26 09:24:39 -07001990if(BUILD_VULKAN)
Dan Sinclair6480d4e2019-03-11 10:48:19 -04001991 if (NOT TARGET SPIRV-Tools)
1992 # This variable is also used by SPIRV-Tools to locate SPIRV-Headers
1993 set(SPIRV-Headers_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/SPIRV-Headers")
1994 list(APPEND VULKAN_INCLUDE_DIR "${SPIRV-Headers_SOURCE_DIR}/include")
Nicolas Capens4e9f5772019-01-31 15:17:13 -05001995
Dan Sinclair6480d4e2019-03-11 10:48:19 -04001996 add_subdirectory(third_party/SPIRV-Tools)
1997 endif()
Nicolas Capens4c9f04b2019-01-31 22:09:03 -05001998
Chris Forbes3d27f2e2018-09-26 09:24:39 -07001999 add_library(libvk_swiftshader SHARED ${VULKAN_LIST})
2000 set_target_properties(libvk_swiftshader PROPERTIES
2001 INCLUDE_DIRECTORIES "${VULKAN_INCLUDE_DIR}"
2002 FOLDER "Vulkan"
Ben Clayton4ceb77d2019-04-24 12:09:59 +01002003 COMPILE_OPTIONS "${SWIFTSHADER_COMPILE_OPTIONS}"
Saman Samif4d2a442019-05-21 15:04:41 -04002004 COMPILE_DEFINITIONS "VK_EXPORT=;NO_SANITIZE_FUNCTION=;$<$<CONFIG:Debug>:DEBUGGER_WAIT_DIALOG>"
Chris Forbes3d27f2e2018-09-26 09:24:39 -07002005 PREFIX ""
2006 )
2007 set_shared_library_export_map(libvk_swiftshader ${SOURCE_DIR}/Vulkan)
Nicolas Capensa69ca602019-02-04 16:23:25 -05002008 target_link_libraries(libvk_swiftshader ${Reactor} ${OS_LIBS} SPIRV-Tools SPIRV-Tools-opt)
Chris Forbes3d27f2e2018-09-26 09:24:39 -07002009 add_custom_command(
2010 TARGET libvk_swiftshader
2011 POST_BUILD
2012 COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:libvk_swiftshader>/translator
2013 COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:libvk_swiftshader> $<TARGET_FILE_DIR:libvk_swiftshader>/translator/${LIB_PREFIX}Vulkan_translator${CMAKE_SHARED_LIBRARY_SUFFIX}
Dan Sinclair1b8cd2d2019-03-14 10:51:05 -04002014 COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/${CMAKE_SYSTEM_NAME}/
2015 COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:libvk_swiftshader> ${CMAKE_BINARY_DIR}/${CMAKE_SYSTEM_NAME}/
Chris Forbes3d27f2e2018-09-26 09:24:39 -07002016 )
Paul Thomsona0b3a022019-06-24 17:16:55 +01002017
2018 # The vk_swiftshader_icd.json manifest file will point to ICD_LIBRARY_PATH.
2019 # Set ICD_LIBRARY_PATH to be a relative path similar to "./libvk_swiftshader.so", so both files can be moved.
2020 # A relative path is relative to the manifest file.
2021 # Note that the library name is always "libvk_swiftshader"; we do not use the platform-specific prefix.
2022 set(ICD_LIBRARY_PATH "libvk_swiftshader${CMAKE_SHARED_LIBRARY_SUFFIX}")
2023 if(WIN32)
2024 # The path is output to a JSON file, which requires backslashes to be escaped.
Ben Claytone671a692019-07-29 13:03:42 +01002025 set(ICD_LIBRARY_PATH ".\\\\${ICD_LIBRARY_PATH}")
Paul Thomsona0b3a022019-06-24 17:16:55 +01002026 else()
2027 set(ICD_LIBRARY_PATH "./${ICD_LIBRARY_PATH}")
2028 endif()
Ben Claytond9ce2582019-02-06 11:54:15 +00002029 configure_file(
2030 "${VULKAN_DIR}/vk_swiftshader_icd.json.tmpl"
Dan Sinclair1b8cd2d2019-03-14 10:51:05 -04002031 "${CMAKE_BINARY_DIR}/${CMAKE_SYSTEM_NAME}/vk_swiftshader_icd.json")
Chris Forbes3d27f2e2018-09-26 09:24:39 -07002032endif()
2033
Corentin Wallez0866b292015-12-09 13:49:40 -05002034###########################################################
Nicolas Capensf53adbd2017-01-06 12:47:46 -05002035# Sample programs
Corentin Wallez0866b292015-12-09 13:49:40 -05002036###########################################################
2037
Nicolas Capensf53adbd2017-01-06 12:47:46 -05002038if(BUILD_SAMPLES)
2039 if(WIN32)
2040 add_executable(OGLES2HelloAPI ${HELLO2_DIR}/OGLES2HelloAPI_Windows.cpp)
2041 set_target_properties(OGLES2HelloAPI PROPERTIES
Erwin Jansend46faeb2018-11-19 16:01:37 -08002042 INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include"
Ben Clayton4ceb77d2019-04-24 12:09:59 +01002043 COMPILE_OPTIONS "${SWIFTSHADER_COMPILE_OPTIONS}"
Nicolas Capensf53adbd2017-01-06 12:47:46 -05002044 COMPILE_DEFINITIONS "GL_GLEXT_PROTOTYPES"
2045 FOLDER "Samples"
2046 )
2047 target_link_libraries(OGLES2HelloAPI libEGL libGLESv2)
2048 set_property(TARGET OGLES2HelloAPI APPEND_STRING PROPERTY LINK_FLAGS "/SUBSYSTEM:WINDOWS")
2049 set(CMAKE_DEFAULT_STARTUP_PROJECT OGLES2HelloAPI)
2050 elseif(LINUX)
Chinmay Garde204ec082016-08-10 17:01:21 -07002051 add_executable(OGLES2HelloAPI ${HELLO2_DIR}/OGLES2HelloAPI_LinuxX11.cpp)
Nicolas Capensb94a2fc2016-10-26 16:57:35 -04002052 set_target_properties(OGLES2HelloAPI PROPERTIES
Erwin Jansend46faeb2018-11-19 16:01:37 -08002053 INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include"
Ben Clayton4ceb77d2019-04-24 12:09:59 +01002054 COMPILE_OPTIONS "${SWIFTSHADER_COMPILE_OPTIONS}"
Nicolas Capensb94a2fc2016-10-26 16:57:35 -04002055 COMPILE_DEFINITIONS "GL_GLEXT_PROTOTYPES"
2056 )
Nicolas Capensf53adbd2017-01-06 12:47:46 -05002057 target_link_libraries(OGLES2HelloAPI dl X11 libEGL libGLESv2) # Explicitly link our "lib*" targets, not the platform provided "EGL" and "GLESv2"
Chinmay Garde204ec082016-08-10 17:01:21 -07002058 elseif(APPLE)
2059 add_executable(OGLES2HelloAPI MACOSX_BUNDLE
2060 ${HELLO2_DIR}/OGLES2HelloAPI_OSX.mm
2061 ${HELLO2_DIR}/Build/OSX/en.lproj/MainMenu.xib
2062 )
2063 set_target_properties(OGLES2HelloAPI PROPERTIES
Erwin Jansend46faeb2018-11-19 16:01:37 -08002064 INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include"
Ben Clayton4ceb77d2019-04-24 12:09:59 +01002065 COMPILE_OPTIONS "${SWIFTSHADER_COMPILE_OPTIONS};-Wno-deprecated-declarations" # 'NSTitledWindowMask', 'NSClosableWindowMask' is deprecated
Chinmay Garde204ec082016-08-10 17:01:21 -07002066 COMPILE_DEFINITIONS "GL_GLEXT_PROTOTYPES"
2067 MACOSX_BUNDLE_INFO_PLIST "${HELLO2_DIR}/Build/OSX/Info.plist"
2068 )
2069 target_link_libraries(OGLES2HelloAPI libEGL libGLESv2 ${OS_LIBS})
2070 set_source_files_properties(${HELLO2_DIR}/Build/OSX/en.lproj/MainMenu.xib PROPERTIES
2071 MACOSX_PACKAGE_LOCATION "Resources"
2072 )
2073 endif()
Corentin Wallez0866b292015-12-09 13:49:40 -05002074endif()
Nicolas Capens16594842017-04-26 10:01:37 -04002075
Nicolas Capensc07dc4b2018-08-06 14:20:45 -04002076if(BUILD_TESTS)
2077 set(REACTOR_UNIT_TESTS_LIST
2078 ${SOURCE_DIR}/Reactor/ReactorUnitTests.cpp
Erwin Jansend46faeb2018-11-19 16:01:37 -08002079 ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googletest/src/gtest-all.cc
Nicolas Capens16594842017-04-26 10:01:37 -04002080 )
2081
Nicolas Capensc07dc4b2018-08-06 14:20:45 -04002082 set(REACTOR_UNIT_TESTS_INCLUDE_DIR
Erwin Jansend46faeb2018-11-19 16:01:37 -08002083 ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googletest/include
2084 ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googletest/
Nicolas Capens16594842017-04-26 10:01:37 -04002085 )
2086
Nicolas Capensc07dc4b2018-08-06 14:20:45 -04002087 add_executable(ReactorUnitTests ${REACTOR_UNIT_TESTS_LIST})
2088 set_target_properties(ReactorUnitTests PROPERTIES
2089 INCLUDE_DIRECTORIES "${REACTOR_UNIT_TESTS_INCLUDE_DIR}"
Ben Clayton4ceb77d2019-04-24 12:09:59 +01002090 COMPILE_OPTIONS "${SWIFTSHADER_COMPILE_OPTIONS}"
Nicolas Capens16594842017-04-26 10:01:37 -04002091 FOLDER "Tests"
2092 )
Nicolas Capensc07dc4b2018-08-06 14:20:45 -04002093
2094 if(NOT WIN32 AND ${REACTOR_BACKEND} STREQUAL "Subzero")
2095 target_link_libraries(ReactorUnitTests ${Reactor} pthread dl)
Nicolas Capens16594842017-04-26 10:01:37 -04002096 else()
Nicolas Capensc07dc4b2018-08-06 14:20:45 -04002097 target_link_libraries(ReactorUnitTests ${Reactor})
Nicolas Capens16594842017-04-26 10:01:37 -04002098 endif()
2099endif()
Nicolas Capens39760e12018-06-04 15:55:45 -04002100
2101if(BUILD_TESTS)
Ben Claytoneba396c2019-04-07 12:42:43 +01002102 set(GLES_UNITTESTS_LIST
Erwin Jansend46faeb2018-11-19 16:01:37 -08002103 ${CMAKE_CURRENT_SOURCE_DIR}/tests/GLESUnitTests/main.cpp
2104 ${CMAKE_CURRENT_SOURCE_DIR}/tests/GLESUnitTests/unittests.cpp
2105 ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googletest/src/gtest-all.cc
Nicolas Capens39760e12018-06-04 15:55:45 -04002106 )
2107
Ben Claytoneba396c2019-04-07 12:42:43 +01002108 set(GLES_UNITTESTS_INCLUDE_DIR
Erwin Jansend46faeb2018-11-19 16:01:37 -08002109 ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googletest/include/
2110 ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googlemock/include/
2111 ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googletest/
2112 ${CMAKE_CURRENT_SOURCE_DIR}/include/
Nicolas Capens39760e12018-06-04 15:55:45 -04002113 )
2114
Ben Claytoneba396c2019-04-07 12:42:43 +01002115 add_executable(gles-unittests ${GLES_UNITTESTS_LIST})
2116 set_target_properties(gles-unittests PROPERTIES
2117 INCLUDE_DIRECTORIES "${GLES_UNITTESTS_INCLUDE_DIR}"
Nicolas Capens39760e12018-06-04 15:55:45 -04002118 FOLDER "Tests"
Ben Clayton4ceb77d2019-04-24 12:09:59 +01002119 COMPILE_OPTIONS "${SWIFTSHADER_COMPILE_OPTIONS}"
Nicolas Capens39760e12018-06-04 15:55:45 -04002120 COMPILE_DEFINITIONS "STANDALONE"
2121 )
2122
Ben Claytoneba396c2019-04-07 12:42:43 +01002123 target_link_libraries(gles-unittests libEGL libGLESv2 ${OS_LIBS})
Stephen Whitee6ab01f2019-04-04 14:31:25 -04002124 if(ANDROID)
Ben Claytoneba396c2019-04-07 12:42:43 +01002125 target_link_libraries(gles-unittests -landroid)
Stephen Whitee6ab01f2019-04-04 14:31:25 -04002126 endif()
Nicolas Capens39760e12018-06-04 15:55:45 -04002127endif()
Ben Clayton654540e2019-02-01 13:08:23 +00002128
2129if(BUILD_TESTS AND BUILD_VULKAN)
Ben Claytoneba396c2019-04-07 12:42:43 +01002130 set(VK_UNITTESTS_LIST
Ben Claytonabb57852019-03-01 14:33:35 +00002131 ${CMAKE_CURRENT_SOURCE_DIR}/tests/VulkanUnitTests/Device.cpp
Ben Clayton654540e2019-02-01 13:08:23 +00002132 ${CMAKE_CURRENT_SOURCE_DIR}/tests/VulkanUnitTests/Driver.cpp
2133 ${CMAKE_CURRENT_SOURCE_DIR}/tests/VulkanUnitTests/main.cpp
2134 ${CMAKE_CURRENT_SOURCE_DIR}/tests/VulkanUnitTests/unittests.cpp
2135 ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googletest/src/gtest-all.cc
2136 )
2137
Ben Claytoneba396c2019-04-07 12:42:43 +01002138 set(VK_UNITTESTS_INCLUDE_DIR
Ben Clayton654540e2019-02-01 13:08:23 +00002139 ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googletest/include/
2140 ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googlemock/include/
2141 ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googletest/
Ben Claytonabb57852019-03-01 14:33:35 +00002142 ${CMAKE_CURRENT_SOURCE_DIR}/third_party/SPIRV-Tools/include
Ben Clayton654540e2019-02-01 13:08:23 +00002143 ${CMAKE_CURRENT_SOURCE_DIR}/include/
2144 )
2145
Ben Claytoneba396c2019-04-07 12:42:43 +01002146 add_executable(vk-unittests ${VK_UNITTESTS_LIST})
Ben Clayton654540e2019-02-01 13:08:23 +00002147 set_target_properties(vk-unittests PROPERTIES
Ben Claytoneba396c2019-04-07 12:42:43 +01002148 INCLUDE_DIRECTORIES "${VK_UNITTESTS_INCLUDE_DIR}"
Ben Clayton654540e2019-02-01 13:08:23 +00002149 FOLDER "Tests"
Ben Clayton4ceb77d2019-04-24 12:09:59 +01002150 COMPILE_OPTIONS "${SWIFTSHADER_COMPILE_OPTIONS}"
Ben Clayton654540e2019-02-01 13:08:23 +00002151 COMPILE_DEFINITIONS "STANDALONE"
2152 )
2153
Ben Claytonabb57852019-03-01 14:33:35 +00002154 target_link_libraries(vk-unittests ${OS_LIBS} SPIRV-Tools)
Ben Clayton654540e2019-02-01 13:08:23 +00002155endif()