[llvm-branch-commits] [libclc] 68cae18 - Revert "[libclc] Move CMake for prepare_builtins to a subdirectory (#148815)"
Tobias Hieta via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Jul 22 01:35:14 PDT 2025
Author: Michał Górny
Date: 2025-07-22T10:35:07+02:00
New Revision: 68cae1896557786703dbda9215b8c8f98761a0a2
URL: https://github.com/llvm/llvm-project/commit/68cae1896557786703dbda9215b8c8f98761a0a2
DIFF: https://github.com/llvm/llvm-project/commit/68cae1896557786703dbda9215b8c8f98761a0a2.diff
LOG: Revert "[libclc] Move CMake for prepare_builtins to a subdirectory (#148815)"
This reverts commit 8a7a64873b13e6fd931b748fbf50b3da26fe7fca. It broke
standalone builds since the necessary variables are now limited in scope
to `libclc/utils` while they are used in the top-level CMakeLists.
Added:
Modified:
libclc/CMakeLists.txt
Removed:
libclc/utils/CMakeLists.txt
################################################################################
diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index 2570d1a106d21..e2871d1b01a16 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -164,14 +164,34 @@ endif()
list( SORT LIBCLC_TARGETS_TO_BUILD )
+# Construct LLVM version define
+set( LLVM_VERSION_DEFINE "-DHAVE_LLVM=0x${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}" )
+
# This needs to be set before any target that needs it
# We need to use LLVM_INCLUDE_DIRS here, because if we are linking to an
# llvm build directory, this includes $src/llvm/include which is where all the
# headers are not $build/include/ which is what LLVM_INCLUDE_DIR is set to.
include_directories( ${LLVM_INCLUDE_DIRS} )
-# Configure prepare_builtins
-add_subdirectory( utils )
+# Setup prepare_builtins tools
+set(LLVM_LINK_COMPONENTS
+ BitReader
+ BitWriter
+ Core
+ IRReader
+ Support
+)
+if( LIBCLC_STANDALONE_BUILD )
+ add_llvm_executable( prepare_builtins utils/prepare-builtins.cpp )
+ set( prepare_builtins_exe prepare_builtins )
+ set( prepare_builtins_target prepare_builtins )
+else()
+ add_llvm_utility( prepare_builtins utils/prepare-builtins.cpp )
+ setup_host_tool( prepare_builtins PREPARE_BUILTINS prepare_builtins_exe prepare_builtins_target )
+endif()
+target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} )
+# These were not properly reported in early LLVM and we don't need them
+target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions )
# Setup arch devices
set( r600--_devices cedar cypress barts cayman )
diff --git a/libclc/utils/CMakeLists.txt b/libclc/utils/CMakeLists.txt
deleted file mode 100644
index ea1d9e9c8ef5f..0000000000000
--- a/libclc/utils/CMakeLists.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-# Construct LLVM version define
-set( LLVM_VERSION_DEFINE "-DHAVE_LLVM=0x${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}" )
-
-# Setup prepare_builtins tools
-set( LLVM_LINK_COMPONENTS
- BitReader
- BitWriter
- Core
- IRReader
- Support
-)
-
-if( LIBCLC_STANDALONE_BUILD )
- add_llvm_executable( prepare_builtins prepare-builtins.cpp )
- set( prepare_builtins_exe prepare_builtins )
- set( prepare_builtins_target prepare_builtins )
-else()
- add_llvm_utility( prepare_builtins prepare-builtins.cpp )
- setup_host_tool( prepare_builtins PREPARE_BUILTINS prepare_builtins_exe prepare_builtins_target )
-endif()
-
-target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} )
-# These were not properly reported in early LLVM and we don't need them
-target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions )
More information about the llvm-branch-commits
mailing list