From b1dfa3f6ccd235878afcd6c09667c8d6289df932 Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Sat, 11 Jan 2025 09:19:00 -0800 Subject: [PATCH] More diagnostics for how bitcode is being generated Signed-off-by: Larry Gritz --- src/cmake/llvm_macros.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cmake/llvm_macros.cmake b/src/cmake/llvm_macros.cmake index e1a35ee51..a0cd7f11b 100644 --- a/src/cmake/llvm_macros.cmake +++ b/src/cmake/llvm_macros.cmake @@ -38,7 +38,12 @@ function ( EMBED_LLVM_BITCODE_IN_CPP src_list suffix output_name list_to_append_ if (NOT LLVM_BC_GENERATOR) message (FATAL_ERROR "You must have a valid llvm bitcode generator (clang++) somewhere.") endif () - message (VERBOSE "Using LLVM_BC_GENERATOR ${LLVM_BC_GENERATOR} to generate bitcode.") + if (LLVM_BC_GENERATOR) + execute_process ( COMMAND ${LLVM_BC_GENERATOR} --version + OUTPUT_VARIABLE LLVM_BC_GENERATOR_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE ) + endif () + message (VERBOSE "Using LLVM_BC_GENERATOR ${LLVM_BC_GENERATOR} v${LLVM_BC_GENERATOR_VERSION} to generate bitcode.") if (NOT LLVM_AS_TOOL) find_program (LLVM_AS_TOOL NAMES "llvm-as" @@ -81,7 +86,7 @@ function ( EMBED_LLVM_BITCODE_IN_CPP src_list suffix output_name list_to_append_ # Command to turn the .cpp file into LLVM assembly language .s, into # LLVM bitcode .bc, then back into a C++ file with the bc embedded! add_custom_command ( OUTPUT ${src_bc} - COMMAND echo + COMMAND echo "BITCODE GENERATION AND EMBEDDING COMMAND:" ${LLVM_COMPILE_FLAGS} ${ALL_INCLUDE_DIRS} -DOSL_COMPILING_TO_BITCODE=1