compor / llvm-ir-cmake-utils

LLVM IR CMake utils for bitcode file manipulation by opt and friends
GNU Lesser General Public License v2.1
68 stars 14 forks source link

Adding source code files from linked libraries #23

Closed tandf closed 1 year ago

tandf commented 1 year ago

Example

add_library(a a.cpp)
add_executable(b b.cpp)
target_link_libraries(b a)

llvmir_attack_bc_targets(b_bc b)

Both b.cpp and a.cpp will be used to generate the IR.

compor commented 1 year ago

Hi there thanks for this, but could you please open an issue so we can discuss further the need for this patch there?

Sorry for being pedantic, but I'm not sure this patch is needed in the first place, since you could use llvmir_attach_bc_targets to the library CMake target separately; this only saves a line and I'm not convinced that "hiding" this behaviour is good for the user since it will go on and generate all the intermediate by-products for a target that we might not be interested in.

compor commented 1 year ago

This discussion is moved to #25