Skip to content

Commit f829eb7

Browse files
author
git apple-llvm automerger
committed
Merge commit '68cae1896557' from llvm.org/release/21.x into stable/21.x
2 parents bd979c1 + 68cae18 commit f829eb7

File tree

2 files changed

+22
-26
lines changed

2 files changed

+22
-26
lines changed

libclc/CMakeLists.txt

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,34 @@ endif()
164164

165165
list( SORT LIBCLC_TARGETS_TO_BUILD )
166166

167+
# Construct LLVM version define
168+
set( LLVM_VERSION_DEFINE "-DHAVE_LLVM=0x${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}" )
169+
167170
# This needs to be set before any target that needs it
168171
# We need to use LLVM_INCLUDE_DIRS here, because if we are linking to an
169172
# llvm build directory, this includes $src/llvm/include which is where all the
170173
# headers are not $build/include/ which is what LLVM_INCLUDE_DIR is set to.
171174
include_directories( ${LLVM_INCLUDE_DIRS} )
172175

173-
# Configure prepare_builtins
174-
add_subdirectory( utils )
176+
# Setup prepare_builtins tools
177+
set(LLVM_LINK_COMPONENTS
178+
BitReader
179+
BitWriter
180+
Core
181+
IRReader
182+
Support
183+
)
184+
if( LIBCLC_STANDALONE_BUILD )
185+
add_llvm_executable( prepare_builtins utils/prepare-builtins.cpp )
186+
set( prepare_builtins_exe prepare_builtins )
187+
set( prepare_builtins_target prepare_builtins )
188+
else()
189+
add_llvm_utility( prepare_builtins utils/prepare-builtins.cpp )
190+
setup_host_tool( prepare_builtins PREPARE_BUILTINS prepare_builtins_exe prepare_builtins_target )
191+
endif()
192+
target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} )
193+
# These were not properly reported in early LLVM and we don't need them
194+
target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions )
175195

176196
# Setup arch devices
177197
set( r600--_devices cedar cypress barts cayman )

libclc/utils/CMakeLists.txt

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)