Skip to content

Commit

Permalink
[libclc] Make CMake messages better fit into LLVM (#86945)
Browse files Browse the repository at this point in the history
The libclc project is currently only properly supported as an external
project. However, when trying to get it to also build in-tree, the CMake
configuration messages it outputs stand out amongst the rest of the LLVM
projects and sub-projects.

This commit makes all messages clear that they belong to the libclc
project, as well as turning them into 'STATUS' messages where
appropriate.
  • Loading branch information
frasercrmck committed Mar 28, 2024
1 parent ae28028 commit e251f56
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions libclc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ option( ENABLE_RUNTIME_SUBNORMAL "Enable runtime linking of subnormal support."
find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_DIR}")
include(AddLLVM)

message( "LLVM version: ${LLVM_PACKAGE_VERSION}" )
message( STATUS "libclc LLVM version: ${LLVM_PACKAGE_VERSION}" )

if( ${LLVM_PACKAGE_VERSION} VERSION_LESS ${LIBCLC_MIN_LLVM} )
message( FATAL_ERROR "libclc needs at least LLVM ${LIBCLC_MIN_LLVM}" )
Expand All @@ -67,14 +67,13 @@ find_program( LLVM_OPT opt PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH )
find_program( LLVM_SPIRV llvm-spirv PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH )

# Print toolchain
message( "clang: ${LLVM_CLANG}" )
message( "llvm-as: ${LLVM_AS}" )
message( "llvm-link: ${LLVM_LINK}" )
message( "opt: ${LLVM_OPT}" )
message( "llvm-spirv: ${LLVM_SPIRV}" )
message( "" )
message( STATUS "libclc toolchain - clang: ${LLVM_CLANG}" )
message( STATUS "libclc toolchain - llvm-as: ${LLVM_AS}" )
message( STATUS "libclc toolchain - llvm-link: ${LLVM_LINK}" )
message( STATUS "libclc toolchain - opt: ${LLVM_OPT}" )
message( STATUS "libclc toolchain - llvm-spirv: ${LLVM_SPIRV}" )
if( NOT LLVM_CLANG OR NOT LLVM_OPT OR NOT LLVM_AS OR NOT LLVM_LINK )
message( FATAL_ERROR "toolchain incomplete!" )
message( FATAL_ERROR "libclc toolchain incomplete!" )
endif()

list( SORT LIBCLC_TARGETS_TO_BUILD )
Expand Down Expand Up @@ -182,7 +181,7 @@ add_custom_target( "clspv-generate_convert.cl" DEPENDS clspv-convert.cl )
enable_testing()

foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
message( "BUILDING ${t}" )
message( STATUS "libclc target '${t}' is enabled" )
string( REPLACE "-" ";" TRIPLE ${t} )
list( GET TRIPLE 0 ARCH )
list( GET TRIPLE 1 VENDOR )
Expand Down Expand Up @@ -265,7 +264,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
set( mcpu "-mcpu=${d}" )
set( arch_suffix "${d}-${t}" )
endif()
message( " DEVICE: ${d} ( ${${d}_aliases} )" )
message( STATUS " device: ${d} ( ${${d}_aliases} )" )

if ( ${ARCH} STREQUAL "spirv" OR ${ARCH} STREQUAL "spirv64" )
if( ${ARCH} STREQUAL "spirv" )
Expand Down

0 comments on commit e251f56

Please sign in to comment.