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 12 forks source link

target definitions do not trickle down to LLVM IR executable and library definitions #7

Closed compor closed 7 years ago

compor commented 7 years ago

e.g., adding a preprocessor definitions with target_compile_definitions holds for the bitcode target but not for the exec and lib target provided by LLVM IR utils.

compor commented 7 years ago

This mainly concerns the linking phase.

However, all the relevant variables (e.g. CMAKE_SHARED_LINKER_FLAGS) work during the linking phase.

Any separately set target properties (e.g. LINK_DEPENDS) should also be set for the relevant bitcode targets. This is duplication of work, but it can be avoid with a trivial user-defined macro.

The rationale behind this is that the bitcode targets might require different stuff during linking and leaving this as is provides for such needed flexibility.