Hello,

This goes somewhere between a question and a feature request.

We are working on mull, https://github.com/mull-project/mull mutation
testing
system based on top of LLVM. Currently the development is mostly focused
around
testing of C++ projects and we use LLVM and its libraries as a playground.

To run Mull against a library like LLVMCore or
LLVMSupport, we need to compile the library, its tests and all of
its dependencies to LLVM bitcode.

Currently the best thing we can do to achieve this so far is to get a
compilation database for a target and all of its dependencies using ninja
and
do some bash magic to patch the `clang ...` commands to
produce a suite of *.bc files which Mull can then consume.

We think that it would be great if CMake had a capability of generating
LLVM bitcode targets out of existing targets with a support of incremental
compilation so that one could iterate on development of a library
and this kind of bitcode target would produce a set of *.bc files in a same
way like
add_library produces libraries.

I have tried to clone the targets by hand using this script as a starting
point:
https://github.com/shadow/shadow/blob/master/cmake/LLVMTools.cmake#L40 but
found
that it was hard to create a clone of existing target to 100% match all of
the
compilation options of a source target. I could make it work for some of the
LLVM targets but overall this approach seems to not be a solid one.

So the following are questions that taken together might constitute a
feature request:

- Can it be possible to recursively clone existing library target created
with
add_library and all of its dependencies?
- Modify this cloned target to produce a set of *.bc files instead of a
binary.
- Have this routine wrapped into a stable and portable CMake function like:
add_llvm_bitcode_target?

Thanks.
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to